Highlighted
Frequent Contributor.. Frequent Contributor..
Frequent Contributor..
467 views

log file flex connector

Hi,

I have been trying to play and understand how can I configure a flex connector to meet my need but much luck and I hope you could help and guide me with this.

I have a bash script that retrieve from internet a list. After it runs, I have a log file which could vary in size (sometimes it's bigger, sometimes not). The mapping goes like this:

delimiter=|

text.qualifier="

comments.start.with=\#

trim.tokens=true

contains.empty.tokens=true

token.count=6

token[0].name=CVE_ID

token[0].type=String

token[1].name=Vendor

token[1].type=String

token[2].name=Model

token[2].type=String

token[3].name=Version

token[3].type=String

token[4].name=Summary

token[4].type=String

token[5].name=URL

token[5].type=String

#event.agentAddress=Token5

#event.deviceProduct=__stringConstant("SampleFlexAgent")

#event.deviceVendor=__getVendor("CVE")

event.deviceVendor=__stringConstant("CVE Extract")

event.name=__stringConstant("CVE Import")

event.endTime=Date

event.deviceCustomString1=CVE_ID

event.message=Summary

event.deviceCustomString2=Vendor

event.deviceCustomString3=Model

event.deviceCustomString4=Version

event.deviceCustomString5=URL

event.deviceProduct=__stringConstant("Test12")

My problem is that I can't find a way to configure the flex connector so that it can detect when a new log is created and it have to manage it.

I can't use rotationscheme=none, usealternaterotationdetection=false, since because the file may grow or can shrink, the flex can only see when the log decrease in size.

I have to try setup a log rotation in my script:

log.1

log.2

log.3

But for what I understand the flex use the highest index value (log.3) for the actual log, and in this case I don't know how to configure the the agents[0].logfilename parameter (<path>/log ?) and the agents[0].rotationschemeparams (log.'%01d,001,003,true' ?).

This thing is starting to male me crazy!

Any help will be very appreciated.

Thanks

Labels (2)
Tags (1)
0 Likes
1 Reply
Highlighted
Frequent Contributor.. Frequent Contributor..
Frequent Contributor..

Re: log file flex connector

Hi,

I am going to reply to myself. I think I was able to solve my issue (still I need to do additional testings ). Instead of using the Log File FlexConnector, I am currently plays with the Folder Follower Flex Connector (option 17 during runagentsetup in the flex connector setup).

I run the folder follower in batch mode. Other settings that I have changed are:

agents[0].foldertable[0].wildcard=list.csv.'%d01,1,5'

(The script generate a file called list.csv.x where x is a number starting with 1)

agents[0].foldertable[0].mode=deletefile

So my script create at the end a file called list.csv.1

The connector scan the folder, found the file because it matches the pattern and then process it and delete the file at the end.

If I run the run another time, even if the file size has changed (inc or decrease), the file is processed anyway.

I'm almost happy . I will try to play with file rotation a little.

Thanks

Romain

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.