Guest User

Untitled

a guest
Feb 16th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. filter {
  2. # Check if message if json compliant. (There will be one blank space in front of the log)
  3. if [message] =~ "\A\s+\{.+\}\z" {
  4. # Strip the leading whitespace.
  5. mutate {
  6. strip => ["message"]
  7. }
  8. # Load the json into worker_log
  9. json {
  10. source => "message"
  11. target => "worker_log"
  12. }
  13. # Add a field to the top level containing the cid value from worker_log
  14. mutate {
  15. add_field => {
  16. "cid" => "%{[worker_log][cid]}"
  17. }
  18. # Delete the temp field so it doesn't create 4 billion fields in ES.
  19. remove_field => worker_log
  20. }
  21. }
  22. }
Add Comment
Please, Sign In to add comment