siddarth talupula Frequent Contributor.
Frequent Contributor.
435 views

Flex connector for multiple log formats

Hello,

I am developing a JSON flex connector. My flex connector works fine only for one type of log type. When the end device generates a different log, then my regex fails. Hence I have individual regex for each log type generated by the device.

I want to know how can I club all my different regex, so the I am able to parse any type of event that is generated by the end device.

 

With Regards,

Siddarth

0 Likes
1 Reply
martynbhp Super Contributor.
Super Contributor.

Re: Flex connector for multiple log formats

This is where you have to use the submessage method.

Typically your log record will have some common fields, usually a timestamp and host-IP, these can be processed for all record type.

You will then have a section - as small as possible if you can - which identifies the submessage. followed by the remainder of the record.

The identifier section will determine which of the submessage sections will process the "remainder of the record".

It is also possible to have a "default" submessage which will process all records which have not been identified as one of the other submessages.

It is quite well explained in the flex connectors development guide. If you need more help post a couple of your example records, or message me directly.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.