Optional Grok Fields
Posted: Wed May 04, 2016 10:08 am
Hello, I am having an issue when I try to parse a logstash log that has an optional field. The optional field is called installer_name, but when I try it doesn't match. I am using http://grokconstructor.appspot.com/do/match#result to test my pattern, and it doesn't get past the installer_name. I have other fields after this that need to be parsed, but it's not letting me get past the installer_name field.
My log looks similar to this:
Not all of them have installer_name.
Any ideas? Thanks!
Code: Select all
(installer_name=%{QS:Bit9_installer_exe})? My log looks similar to this:
Code: Select all
<13>May 04 12:40:31 Bit9.xxxx.com Bit9 event: text="File 'c:\windows\temp\low\skypeclicktocall\download\skypetoolbars.msi' [8fb885c633a92a5391b9493afff529b12bdd90cbcbe15045612711280ad4b027] was blocked because it was unapproved." type="Policy Enforcement" subtype="Execution block (unapproved file)" hostname="523-AAPALMER-LT" username="NT AUTHORITY\SYSTEM" date="5/4/2016 12:40:21 PM" ip_address="192.168.1.1" process="c:\windows\system32\msiexec.exe" file_path="c:\windows\temp\low\skypeclicktocall\download\skypetoolbars.msi" file_name="skypetoolbars.msi" file_hash="8fb885c633a92a5391b9493afff529b12bdd90cbcbe15045612711280ad4b027" installer_name="skypec2cautoupdatesvc.exe" policy="MPA-High" rule_name="Block unapproved scripts" process_key="00000178-0000-1954-01d1-a6021ef1126c" server_version="7.2.1.1562" file_trust="-1" file_threat="-1" process_trust="10" process_threat="0"Any ideas? Thanks!