Hi Folks,
I am using Logstash 7.8 version and i will be getting logs from multiple data sources as part of my requirement.
I wanted to apply a filter on my log message coming from filebeat and containing the string "pam_sm_open_session" so that i can add a tag to the message and send it to my desired destination.
I have tried using the below to get the desired output, how ever it is not working for me.
my log message: "Mar 18 23:20:01 PAM-unixteam[14***]: pam_sm_open_session(service=crond, terminal=cron, user=root, ruser=UNDEF, rhost=UNDEF)"
I am using the below filter, to add a tag
if [agent_type] == "filebeat" {
if [message] =~ "pam_sm_open_session" { mutate { add_tag => [ "UNIX" ] } }
}
also tried like below.
if [agent_type] == "filebeat" {
if "pam_sm_open_session" in [message] { mutate { add_tag => [ "Unix ] } }
}
but both of them are not working and not giving the expected results.
Appreciate if anyone can help me in resolving this.. Thanks alot.