I am exploring ingest pipeline. The grok is working as expected.
But, I am looking into just executing/running the grok pattern if the field have a certain string. How can I add a if condition where "if message =~ ssh2" then run grok pattern, if not, do not extract.
POST _ingest/pipeline/_simulate
{
"pipeline": {
"description": "..",
"processors": [
{
"grok": {
"field": "message",
"patterns": ["%{SYSLOGTIMESTAMP:syslog_timestamp} %{DATA:secure_server_name} %{WORD:secure_service}\\[%{NUMBER:secure_process_id}\\]: %{DATA:secure_outcome} for (invalid user %{DATA:secure_user}|%{DATA:secure_user}) from %{IP:secure_ip} port %{NUMBER:secure_port} %{DATA}$"]
}
}
]
},
"docs": [
{
"_source":{
"message":"Feb 11 18:59:20 _TEST-ELK sshd[1205325]: Accepted password for test-user from 192.168.1.10 port 60912 ssh2"
}
}]
}
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.