Highlighted
jgervais Absent Member.
Absent Member.
630 views

Is there a way to map the file name of the log file you are parsing into an ArcSight field?

I would like to put the name of the file I am reading with the parser into the fileName field. Is this possible?

Labels (2)
Tags (2)
0 Likes
3 Replies
rhope Acclaimed Contributor.
Acclaimed Contributor.

Re: Is there a way to map the file name of the log file you are parsing into an ArcSight field?

Page 119 of the Flex Connector Developers Guide explains how to do this. It is configured in agent.properties

0 Likes
akshayinnamuri Absent Member.
Absent Member.

Re: Is there a way to map the file name of the log file you are parsing into an ArcSight field?

you need to add the agents[x].extractregex parameter into your agent.properties file

agents[x].usefieldextractor = true

agents[x].extractsource =  “File Name”

agents[x].extractfieldnames = filename

example:

agents[0].foldertable[0].extractfieldnames=sourceHostName,sourceAddress

agents[0].foldertable[0].extractregex=\S:\\\\\S+\\\\(\S+)_(\d+\.\d+\.\d+\.\d+)\\\\\S+\.txt

agents[0].foldertable[0].extractsource=File Path

agents[0].foldertable[0].folder=M\:\\logs\\hostname_1.2.3.4

2)

agents[0].foldertable[0].extractfieldnames=fileName

agents[0].foldertable[0].extractregex=(.*)

agents[0].foldertable[0].extractsource=File Name

agents[0].foldertable[0].usefieldextractor=true

explanation:

say your filename is of the "d:\abcd_192.168.1.122.txt" and you are interested to extract the fields like filename and IPaddress, then you need to add the agent.properties like below

agents[0].extractsource=File Name

agents[0].usefieldextractor=true

agents[0].extractregex=/([^_]+)_(\d+.\d+.\d+.\d+).txt

agents[0].extractfieldnames=fileName,destinationAddress

here,

([^_]+) ---> extracts the Filename

(\d+.\d+.\d+.\d+) --> destinationAddress

tahira2211 Absent Member.
Absent Member.

Re: Is there a way to map the file name of the log file you are parsing into an ArcSight field?

Hi,

I have developed a connector of DNS but I cannot see which host is it coming from.

I have tried adding them to agent.properties but still I cannot see deviceHostname

agents[x].usefieldextractor =

agents[0].foldertable[0].extractfieldnames=

agents[0].foldertable[0].extractregex=

agents[0].foldertable[0].extractsource=File Name

Is there any possibility that deviceAddress or deviceHostname can be visible in ESM events?

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.