Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- filter {
- # Check if message if json compliant. (There will be one blank space in front of the log)
- if [message] =~ "\A\s+\{.+\}\z" {
- # Strip the leading whitespace.
- mutate {
- strip => ["message"]
- }
- # Load the json into worker_log
- json {
- source => "message"
- target => "worker_log"
- }
- # Add a field to the top level containing the cid value from worker_log
- mutate {
- add_field => {
- "cid" => "%{[worker_log][cid]}"
- }
- # Delete the temp field so it doesn't create 4 billion fields in ES.
- remove_field => worker_log
- }
- }
- }
Add Comment
Please, Sign In to add comment