Deployment Architecture

Input.conf issue monitoring same directory multiple times

Naa_Win
Path Finder

I have a inputs.conf where it will monitor all the files from a folder 

[monitor:///mydata/my_folder/ToSplunk/*.(mylogfile|edi.mylogfile|edi)]
index = xyz
_TCP_ROUTING = dev_indexers,qa_indexers
sourcetype = XYZ_SRCTYPE
crcSalt = <SOURCE>

Also, I wanted to monitor same directory with different files as a different sourcetype. Also these two stanza will have respective props. 

[monitor:///mydata/my_folder/ToSplunk/*.ABC.xml.ToSplunk.edi]
index = xyz
sourcetype = XYZ_SRCTYPE:ABC
_TCP_ROUTING = dev_indexers,qa_indexers
crcSalt = <SOURCE>

Tags (2)
0 Karma
1 Solution

Naa_Win
Path Finder

Hello @gcusello ,

Thanks for the reply. 

I had tried this way...
included blacklist to get rid of the (ABC.xml.ToSplunk.edi) file from falling under that sourcetype and made new stanza to take up other sourcetype, that worked !!

[monitor:///mydata/my_folder/ToSplunk/*.(mylogfile|edi.mylogfile|edi)]
index = xyz
_TCP_ROUTING = dev_indexers,qa_indexers
sourcetype = XYZ_SRCTYPE
blacklist= (ABC.xml.ToSplunk.edi)
crcSalt = <SOURCE>


[monitor:///mydata/my_folder/ToSplunk/*.ABC.xml.ToSplunk.edi]
index = xyz
sourcetype = XYZ_SRCTYPE:ABC
_TCP_ROUTING = dev_indexers,qa_indexers
crcSalt = <SOURCE>

I had similar issue with the source, can you help me how this works?
https://community.splunk.com/t5/Deployment-Architecture/stanza-for-inputs-conf-is-not-working/m-p/65... 

View solution in original post

0 Karma

Naa_Win
Path Finder

Hello @gcusello ,

Thanks for the reply. 

I had tried this way...
included blacklist to get rid of the (ABC.xml.ToSplunk.edi) file from falling under that sourcetype and made new stanza to take up other sourcetype, that worked !!

[monitor:///mydata/my_folder/ToSplunk/*.(mylogfile|edi.mylogfile|edi)]
index = xyz
_TCP_ROUTING = dev_indexers,qa_indexers
sourcetype = XYZ_SRCTYPE
blacklist= (ABC.xml.ToSplunk.edi)
crcSalt = <SOURCE>


[monitor:///mydata/my_folder/ToSplunk/*.ABC.xml.ToSplunk.edi]
index = xyz
sourcetype = XYZ_SRCTYPE:ABC
_TCP_ROUTING = dev_indexers,qa_indexers
crcSalt = <SOURCE>

I had similar issue with the source, can you help me how this works?
https://community.splunk.com/t5/Deployment-Architecture/stanza-for-inputs-conf-is-not-working/m-p/65... 

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @Naa_Win,

good for you, see next time!

let me know if I can help you more, or, please, accept one answer for the other people of Community.

Ciao and happy splunking

Giuseppe

P.S.: Karma Points are appreciated 😉

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @Naa_Win,

at first you cannot use the OR operator ("|") in the monitor header, you have to use whitelist option:

[monitor:///mydata/my_folder/ToSplunk/]
index = xyz
_TCP_ROUTING = dev_indexers,qa_indexers
sourcetype = XYZ_SRCTYPE
whitelist = *.(mylogfile|edi.mylogfile|edi)
crcSalt = <SOURCE>

thesecond problem is that the last condition in the first stanza also includes the second stanza condition, so you have to use two (or more) different conditions to avoid overlappings.

Ciao.

Giuseppe

Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Take Action Automatically on Splunk Alerts with Red Hat Ansible Automation Platform

 Are you ready to revolutionize your IT operations? As digital transformation accelerates, the demand for ...

Calling All Security Pros: Ready to Race Through Boston?

Hey Splunkers, .conf25 is heading to Boston and we’re kicking things off with something bold, competitive, and ...

Beyond Detection: How Splunk and Cisco Integrated Security Platforms Transform ...

Financial services organizations face an impossible equation: maintain 99.9% uptime for mission-critical ...