I've been modifying GROK patterns for postfix from GitHub - ActionScripted/elastic-kibana-postfix: Kibana dashboards, visualizations and searches for Postfix so that it can include "warning" from postfix' header_check since I've added subject to appear in log file.
I've also modified rsyslog so that log file from postfix' header_check goes into separate file.
Basically i wanted specific "postfix_to" and "postfix_from" with "subject" field. Since there is no 'subject' field i just wanted it to go to postfix_message, so there is no need to chase it through logs. But. There is a catch.
Example from log file is like this:
6F4234C1362: warning: header Subject: Embedded Net DVR: Motion Detected On Channel A3 from mail.xxx.rs[77.66.77.66]; from=from@mail.rs to=another@recipient.com proto=ESMTP helo=<mail.xxx.rs>
And this pattern checks out JUST FINE in Dev Tools/Grok Debugger. But when live..
All is good except postfix_message which should contain JUST the subject with Subject prefix... But instead, it contains a word before GREEDYDATA and a word AFTER.
This is from Grok Debugger:
{
"postfix_to": "another@recipient.com",
"postfix_queueid": "6F4234C1362",
"postfix_subject": "Subject: Embedded Net DVR: Motion Detected On Channel A3 ",
"postfix_from": "from@mail.rs"
}
I love this ! This is cool!
But live i get this
"postfix_message": " header Subject: Embedded Net DVR: Motion Detected On Channel A3 from mail.3dnet.rs[77.105.38.87]"
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.