This tale is about me fighting a deep fight against "Percy the Custom Syslog-Parser".
the epilog to this series can be found here
Once upon a time...
I got the task to write a parser for data which will arrive via a syslog connector.
Easy task i thought - but far wrong.
The data did not have a syslog header... so I thought okay, give it a try, write a parser and see what happens.
And it came as it was expected - bad dragons all over the place.
First of all, I was unsure if my custom parser got picked up. So I read the magic book called "HPE ArcSight FlexConnector Developer's Guide" - over and over again, but yes i was right,
- it told me to put my file in ARCSIGHT_HOME\user\agent\flexagent\syslog
- and i should give it the name <vendor>.subagent.sdkrfilereader.properties
and than everything should work.
No chance!
My data was always picked up by "IBM|AIX_audit" parser, a very evil small parser... (ahh by the way I used SmartConnector Flame-Work Version 7.4)
So my next idea was not to fight against all syslog parsers in one fight, but just let my parser run alone.
I checked tha magic book (see above) and found out that I can limit the dragons(parsers) I need to fight with
- agents[x].customsubagentlist
- "Set this property to the restricted subagent list based on device types in your environment."
and I should
- set agents[x].usecustomsubagentlist=true
in the agent.properies file.
But my sword was a dull saber, as my parser called serioussam never was picked up by the SmartConnector-flamework when I set
agents[0].customsubagentlist=serioussam and
agents[0].usecustomsubagentlist=true
I checked varios tales about custom syslog parser an a invite only dragon hunt community called "protect724" - found a lot of helpless combatants like
- Problems with syslog flexconnector:
the later one desciebed my isseu as well, but nobody was able to help this lost soul.
So i went back and set
agents[0].usecustomsubagentlist=false
and I checked the all-knowing oracle (not Oracle) called the agent.log which lives in the dark corner of ARCSIGHT_HOME\current\logs.
Some black magician told me once to move this file to another place or rename it befor I ask my question, to have a clear view on the logs
And so I did, and after sending some test data to the syslog-dragon, I could see
- [INFO ][default.com.arcsight.common.config.AgentPropertiesFileConfiguration][customInitialization] customInitialization() - read properties from file [C:\arcsight\74x\current\user\agent\flexagent\syslog\serioussam.subagent.sdkrfilereader.properties
So I asked myself whats wong with the usecustomsubagentlist and the customsubagentlist
and then i saw the light at the ond of the tunnel - and it was not a train:
- agents[0].customsubagentlist
seems only be handling self written parsers if you add another dragon here, I chose
- agents[0].customsubagentlist=flexagent_syslog|serioussam
and set
- agents[0].usecustomsubagentlist=true
And they lived happily ever after, my parser was picked up now and the AIX monster was elimated forever.
Lessons Learned
- custom parsers need to live in ARCSIGHT_HOME\user\agent\flexagent\syslog
- custom parsers need to be named <vendor>.subagent.sdkrfilereader.properties
- it is not needed to that event.deviceVendor=__getVendor(SecondEncounter) (in parser file) needs to match the <vendor> portion of the properties file
- you can set agents[0].usecustomsubagentlist=true, but its not mandatory
- if you set it, don't put only your custom parser in the customsubagentlist, but add flexagent_syslog and generic_syslog as well
- |([^|]*)| means "catch-all" between two pipes, but not a pipe itself
- You can enable massive debug output setting this in agent.properties
- log.channel.file.property.package.com.arcsight=0
- log.global.debug=true
- You dont need a proper syslog header, just a good regex! to write a parser
p.s. 2024
check below for updates debug paremeters (unverified)