Hi,
I have 2 inputs in a config file where I need to send a field from one to another if a condition is met. However I'm failing to find documentation on how to reference the fields living in different input events.
Below I put a simple example on what I'm trying to do to not overcomplicate the question, since my real requirement is to combine DB2 and Elasticsearch inputs.
input {
generator {
lines => ["1234"]
count => 1
type => "db"
}
generator {
lines => ["5678"]
count => 1
type => "es"
}
}
filter {
if [type] == "db" {
mutate {
add_field => { "from_es_event" => "%{[type:es][message]}" }
}
}
}
This is the result expected:
"sequence" => 0, "@timestamp" => 2017-11-29T01:57:02.933Z, "from_es_event" => "5678", "message" => "1234", "type" => "db"
How can I accomplish this?