<div dir="ltr"><div><div><div>Hi,<br><br></div>I am in the process of writing a cisco-parser() myself, which uses a combination of csv-parser() and regexps, pattern-db is not very well suited for breaking apart Cisco like conditional structure (which depends on various settings on the cisco side).<br><br></div>While handling various settings (service sequence-numbers, service timestamps, logging origin-id, etc), it achieves about 37k msg/sec. What is your target number with regards to performance?<br><br></div>Here's my stuff:<br><a href="https://github.com/balabit/syslog-ng/pull/1456">https://github.com/balabit/syslog-ng/pull/1456</a><br><br></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">-- <br>Bazsi<br></div></div></div>
<br><div class="gmail_quote">On Tue, May 2, 2017 at 2:17 AM, Schoonover, Mark E HHHH <span dir="ltr"><<a href="mailto:Mark.Schoonover@cigna.com" target="_blank">Mark.Schoonover@cigna.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div link="#0563C1" vlink="#954F72" lang="EN-US">
<div class="m_7655918872652418155WordSection1">
<p class="MsoNormal">Thanks for reading,<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I’m in the process of creating a log to trap for Cisco devices. I have it working for facilities like this: TRINITY-2-TRINITY_SYSLOG_CRIT with this pattern:<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">@ESTRING::%@@ESTRING:.cisco.<wbr>Facility:-@@ESTRING:.cisco.<wbr>Severity:-@@ESTRING:.cisco.<wbr>MsgName::@ @ANYSTRING:.cisco.MsgText@<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Now there are other facilities with an additional hyphen before the severity: EARL-DFC1-1-EXCESSIVE_PARITY_<wbr>ERROR:<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Apr 26 14:04:45 hostname 565049: Apr 26 18:04:43.476 UTC: %EARL-DFC1-1-EXCESSIVE_PARITY_<wbr>ERROR: EARL 0: Parity error detected in VRAM'<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">which parses into:<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><span style="font-family:Consolas">Testing message: program='EARL-DFC1-1-<wbr>EXCESSIVE_PARITY_ERROR' message='Apr 26 14:04:45 hostname 565049: Apr 26 18:04:43.476 UTC: %EARL-DFC1-1-EXCESSIVE_PARITY_<wbr>ERROR: EARL 0: Parity error detected in VRAM'<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">Match name='.classifier.rule_id', value='09944c71-95eb-4bc0-<wbr>8575-936931d85715', expected='09944c71-95eb-4bc0-<wbr>8575-936931d85715'<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">Wrong match name='.cisco.Facility', value='EARL', expected='EARL-DFC1'<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">Wrong match name='.cisco.Severity', value='DFC1', expected='1'<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">Wrong match name='.cisco.MsgName', value='1-EXCESSIVE_PARITY_<wbr>ERROR', expected='EXCESSIVE_PARITY_<wbr>ERROR'<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">Match name='.cisco.MsgText', value='EARL 0: Parity error detected in VRAM', expected='EARL 0: Parity error detected in VRAM'</span><u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I’ve tried a pattern that would parse EARL and DFC1 into separate variables, then append them into .cisco.Facility – which didn’t work. Still that leaves the pattern hardcoded to just two hypens. I’ve also tried hard coding EARL-DFC1 into
the pattern, then use value to set .cisco.Facility correctly. This approach works but being hardcoded, another Facility with embedded hyphens will fail. Ideally I’d like to have a pattern that matches on the last hyphen before the severity and capture that.
I could parse using a regexp and setting $1, $2, $3, and $4 to the appropriate variables but I’m concerned about performance issues – I’m thinking this is a last resort solution.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Any thoughts on how to proceed?<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><span style="font-family:Consolas">Regards,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">Mark Schoonover – KA6WKE<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">Infrastructure Engineering Manager, Splunk Architect<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">ENE : Tools, Instrumentation and Common Services Team<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">Office: 32.8697° N, 116.9711° W
<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">Phone : 770-261-7934 <u></u>
<u></u></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">Email : <a href="mailto:mark.schoonover@cigna.com" target="_blank">
mark.schoonover@cigna.com</a><u></u><u></u></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1f497d">HPSM Team: ENE NMS Engineering<u></u><u></u></span></b></p>
<p class="MsoNormal"><span style="font-family:Consolas"><u></u> <u></u></span></p>
<p class="MsoNormal"><i><span style="color:#1f497d">Confidential, unpublished property of CIGNA. Do not duplicate or distribute. Use and distribution limited solely to authorized personnel. © Copyright 2017 CIGNA<u></u><u></u></span></i></p>
<p class="MsoNormal"><span style="font-family:Consolas"><u></u> <u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<p>------------------------------<wbr>------------------------------<wbr>------------------<br>CONFIDENTIALITY NOTICE: If you have received this email in error,<br>please immediately notify the sender by e-mail at the address shown. <br>This email transmission may contain confidential information. This <br>information is intended only for the use of the individual(s) or entity to <br>whom it is intended even if addressed incorrectly. Please delete it from <br>your files if you are not the intended recipient. Thank you for your <br>compliance. Copyright (c) 2017 Cigna<br>==============================<wbr>==============================<wbr>==================</p></div>
<br>______________________________<wbr>______________________________<wbr>__________________<br>
Member info: <a href="https://lists.balabit.hu/mailman/listinfo/syslog-ng" rel="noreferrer" target="_blank">https://lists.balabit.hu/<wbr>mailman/listinfo/syslog-ng</a><br>
Documentation: <a href="http://www.balabit.com/support/documentation/?product=syslog-ng" rel="noreferrer" target="_blank">http://www.balabit.com/<wbr>support/documentation/?<wbr>product=syslog-ng</a><br>
FAQ: <a href="http://www.balabit.com/wiki/syslog-ng-faq" rel="noreferrer" target="_blank">http://www.balabit.com/wiki/<wbr>syslog-ng-faq</a><br>
<br>
<br></blockquote></div><br></div>