Hi again,
i hav written following 2 pattern inside single match because i hav log files with 2 different patterns:
grok
{
match => ["message","%{BR1}%{SYSTEMDATE:timestamp}%{BR2} %{GREEDYDATA:Msg}",
"message","%{GREEDYDATA}process name %{GREEDYDATA:ProcessName}and process id %{NUMBER:ProcessId}"]
}
And i have used add_field as follows:
if "process id" not in [message]
{
mutate{
add_field => ["pp"=>"%{ProcessId}"]
}
}
Here problem is that process id appears event matching with second match pattern but i want to use that process id to be added as field in the events matching the first match pattern.
But as for first match pattern there doesn't exist any process id while using add_field its value is added as string :pp=>%{ProcessId} .
So can any1 suggest how to use value from 1 match pattern to be added into event matching other match pattern ,
Thnks in advance