Hi All ,
I have a log set . Only the time stamp is the common factor . All other part of the log is some java errors . Doesn't have any common structure. I am categorizing the error types by particular word's presence in the log . I need to take some actions based on the error types.
Example detected grok patterns
- %{TIMESTAMP_ISO8601:Date}%{GREEDYDATA:Log}ABCD%{GREEDYDATA:Log}KLM%{GREEDYDATA:Log}
- %{TIMESTAMP_ISO8601:Date}%{GREEDYDATA:Log}1234%{GREEDYDATA:Log}89%{GREEDYDATA:Log}
- %{TIMESTAMP_ISO8601:Date}%{GREEDYDATA:Log}XXX%{GREEDYDATA:Log}YYY%{GREEDYDATA:Log}
How can I create actions for these three types of patterns?
Example
if pattern 1
Then
mutate {
add_field => { "Error_Type" => "ABCD" }
add_field => { "Caused_By" => "KLM"}
}
if pattern 2
Then
mutate {
add_field => { "Error_Type" => "1234" }
add_field => { "Caused_By" => "89"}
}