Highlighted
brett.pladna@hp Respected Contributor.
Respected Contributor.
1036 views

How do you create a flex connector that reads multiple files in the same directory?

I noticed that the siteminder connector reads multiple files in the same folder. I am trying to create a flex for a platform that uses multiple files in the same folder. I noticed this in the siteminder agent.properties file:

agents[0].smaccess=
agents[0].smaccess_Acct=
agents[0].smaccess_Adm=
agents[0].smaccess_Auth=
agents[0].smaccess_Az=
agents[0].smps=

I took out the file locations but each of those has the exact same path. Each has a different file name, of course. What is .smaccess triggering? Do I need a special script for the flex connector I want to create?

Labels (2)
0 Likes
13 Replies
Till
New Member.

Re: How do you create a flex connector that reads multiple files in the same directory?

You probably can't just replicate that mechanism from the siteminder connector.

I would asume that a real-time folder reader is the way to go.

Do all the files have the same format? Can you cover then with a single parser?

0 Likes
brett.pladna@hp Respected Contributor.
Respected Contributor.

Re: How do you create a flex connector that reads multiple files in the same directory?

They are all.log files. I can tell the file reader agent.properties file to look at all .log files right? (i.e *.log?)

0 Likes
Till
New Member.

Re: How do you create a flex connector that reads multiple files in the same directory?

sure. But do they all have the same format?

0 Likes
brett.pladna@hp Respected Contributor.
Respected Contributor.

Re: How do you create a flex connector that reads multiple files in the same directory?

yes they do because they were using a folder reader flex. I just tried the /*.log and it can't read it. it's literally looking for *.log. Did I do something wrong?

0 Likes
randylle1 Absent Member.
Absent Member.

Re: How do you create a flex connector that reads multiple files in the same directory?

Did you ever get your answer? I am having the same issue?

0 Likes
ianfitz Outstanding Contributor.
Outstanding Contributor.

Re: How do you create a flex connector that reads multiple files in the same directory?

Are you guys using multi folder follower connectors?  If so you can just set the folder path, and for each entry in the list of folders, specify the appropriate wildcard in agent.properties to read the file that you are interested in.  You can configure each folder/file to be handled by the same flex parser.

HTH,

Ian,

0 Likes
brett.pladna@hp Respected Contributor.
Respected Contributor.

Re: How do you create a flex connector that reads multiple files in the same directory?

I will give it a try.

Thanks,

Brett Pladna

0 Likes
randylle1 Absent Member.
Absent Member.

Re: How do you create a flex connector that reads multiple files in the same directory?

Ian

What does the entry look like inside the properties file to tell which parser to use. I have it where it is able to read all files with .txt and rename it to .processed when it is done. The issue is that it is not using my custom parser since all the information is being dumped into the message field.

Any ideas?

v/r

Randy

0 Likes
brett.pladna@hp Respected Contributor.
Respected Contributor.

Re: How do you create a flex connector that reads multiple files in the same directory?

We got this to work. Thanks for all the help.

Thanks,

Brett Pladna

0 Likes
ianfitz Outstanding Contributor.
Outstanding Contributor.

Re: How do you create a flex connector that reads multiple files in the same directory?

Randy:

For a general syslog style file, you could use something like this (for some reason the file has double /'s) which will use the system subagent for syslog events:

agents[0].foldertable[0].configfile=syslog/syslog.subagent

agents[0].foldertable[0].configfolder=/full/path/to/current/user/agent//flexagent/

agents[0].foldertable[0].configtype=sdkrfilereader

...

agents[0].foldertable[0].folder=/var/log

...

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

...

agents[0].foldertable[0].processingmode=realtime

...

agents[0].foldertable[0].wildcard=messages

...

Regards,

Ian.

0 Likes
randylle1 Absent Member.
Absent Member.

Re: How do you create a flex connector that reads multiple files in the same directory?

Thank you

I will try this and hope to get it working.

Thanks again

Randy

0 Likes
brett.pladna@hp Respected Contributor.
Respected Contributor.

Re: How do you create a flex connector that reads multiple files in the same directory?

Do I use the subagent folder so that when the logs are read, they will only pass to the parser that matches its events?

0 Likes
jayakrishnan_p1 Absent Member.
Absent Member.

Re: How do you create a flex connector that reads multiple files in the same directory?

Hi Brett Planda,

I have the same issue but with log files have different formats.

Anyway if i know how you did for multi log files with same format, then i will get some idea.

Please share your method.

Thanks in Advance

Jayakrishnan

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.