Skip to content

Instantly share code, notes, and snippets.

@andrewvc
Created November 13, 2015 20:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewvc/b25097d19aa50df8e05f to your computer and use it in GitHub Desktop.
Save andrewvc/b25097d19aa50df8e05f to your computer and use it in GitHub Desktop.
input {
generator {
lines => ["foo", "bar", "baz", "something bad"]
count => 1000000
}
}
filter {
if [message] == "foo" {
mutate { add_field => { "is_foo" => true }}
} else if [message] =~ /^b/ {
mutate { add_field => { "starts_with_b" => true} }
if [message] == "bar" {
mutate { add_field => {"is_bar" => true} }
} else {
mutate { add_field => {"is_bar" => false} }
}
}
}
output {
file { path => "/tmp/somefile" codec => "json_lines" }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment