Getting Data In

How to input more than one sourcetype data from a directory ?

lzhang_soliton
Path Finder

Hi,

I have been storing two types of log in the same directory. One is ANSI, another is Unicode. I use different definition of file name to distinguish like xxA.csv and xxW.csv.

I would like to let the directory as a input and index both of the types. I could use whitelist attributes in inputs.conf to separate them into two sourcetypes. But I cannot figure out how to the merge the following stanzas into one.

[monitor://C:\myLog]
disabled = false
followTail = 0
index = main
whitelist = W\.csv
sourcetype = myutf16

[monitor://C:\myLog]
disabled = false
followTail = 0
index = main
whitelist = A\.csv
sourcetype = myansi

Does anyone know how to do this?

Thank you!

Tags (2)
0 Karma
1 Solution

martin_mueller
SplunkTrust
SplunkTrust

You cannot merge those two stanzas into one because their setting for sourcetype is different. If you merged them you could only keep one sourcetype.

Consider adding the distinguishing part to the path in the stanza header.

View solution in original post

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

You cannot merge those two stanzas into one because their setting for sourcetype is different. If you merged them you could only keep one sourcetype.

Consider adding the distinguishing part to the path in the stanza header.

0 Karma

lzhang_soliton
Path Finder

martin_mueller,

Thanks for your post!

I added asterisk(*) to one of paths in the stanza header. It works well.

[monitor://C:\myLog]
whitelist = W.csv
sourcetype = myutf16

[monitor://C:\myLog/*]
whitelist = A.csv
sourcetype = myansi

I really appreciate your comments!

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Index This | What travels the world but is also stuck in place?

April 2026 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Discover New Use Cases: Unlock Greater Value from Your Existing Splunk Data

Realizing the full potential of your Splunk investment requires more than just understanding current usage; it ...

Continue Your Journey: Join Session 2 of the Data Management and Federation Bootcamp ...

As data volumes continue to grow and environments become more distributed, managing and optimizing data ...