Getting Data In

Multiple files in one folder as one source

Moritz
Explorer

Hallo there,
i have Logs which are devided into 16000 line logs. In Splunk every part of the Log is an extra source.

What is the best way to work with them as a logical single Log?

Tags (2)
0 Karma

Moritz
Explorer

My best solution is to add a field with the folder name:

source="C:\\..\\Logs\\*" | rex field=source ".*[//\\\]+(?<folder>.*)[//\\\]+.[a-zA-Z.0-9]*"

than i can use it for timechart for example:

source="C:\\..\\Logs\\*" | rex field=source ".*[//\\\]+(?<folder>.*)[//\\\]+.[a-zA-Z.0-9]*" | timechart count by folder
0 Karma

MuS
SplunkTrust
SplunkTrust

Hi Moritz,

assign your own sourcetype to the monitor stanza in inputs.conf. This way you can search for the sourcetype instead of searching for source like this:

sourcetype=YourNewMagicSourceType | ....

or you simply search for all of your logs like this:

source=YourLogFiles* | .....

hope this helps ...

cheers, MuS

Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...