Hey everyone,
I'm new to using Logstash and Elasticsearch. I've been working on collecting logs through Filebeat and then using Logstash for parsing and data cleaning. I have two Grok patterns in place. The first one extracts some important fields, including a field called 'my_message' which holds a chunk of data(Gready Data). I'm then applying another Grok pattern on this 'my_message' field to extract specific attributes.
Individually, both Grok patterns work fine. However, when I try to use them together, some attributes don't get extracted as expected. I've always found this community to be really helpful, and I believe you can assist me with this too. Thanks a lot in advance!
input {
beats {
port => 5045
}
}
filter {
if "jicofo" in [tags] {
grok {
match => {
"[event][original]" => "Jicofo %{TIMESTAMP_ISO8601:my_timestamp} %{LOGLEVEL:my_log_level}: \[%{POSINT:my_process_id}\] (?:\[room=%{DATA:my_meeting_name}@%{DATA}(?:\s+meeting_id=%{UUID:my_meeting_id}(?:\s+participant=%{DATA:my_participant})?)?\] )?\[%{GREEDYDATA:my_message}\]"
}
}
grok {
match => {
"my_message" => [
"Received session-accept \"%{GREEDYDATA:received_message}\"",
"Sending a queued source-add, %{GREEDYDATA:sources_from}",
"sources=%{GREEDYDATA:sources_equals}",
"sources from %{DATA:sources_from_brackets}:\s*\[%{GREEDYDATA:sources}\]",
"Member joined:%{DATA:member_joined} stats-id=%{DATA:stats_id} audioMuted=%{DATA:audio_muted} videoMuted=%{DATA:video_muted} role=%{DATA:role} isJibri=%{DATA:is_jibri} isJigasi=%{DATA:is_jigasi} isTranscriber=%{DATA:is_transcriber}, room=%{DATA:room}",
"Room destroyed with reason=%{DATA:room_destroyed_reason}"
]
}
}
}
}
output {
if [tags] and "jicofo" in [tags] {
elasticsearch {
hosts => ["elasticSearch_Host:9200"]
index => "jicofo-%{+YYYY}"
}
}
}