Splunk Search

index files in same directory

stwong
Communicator

Hi all,

I'm a newbie to Splunk. I tried to index all apache log files in the same directory as a single source so that I can do searching of all files as a whole. However, each file becomes an independent source in the search page. Then I've to use multiple "source=" query to search records in different files.

Is it possible to make all files in the directory as a single source ?

Thanks a lot.
/ST Wong

Tags (2)
0 Karma
1 Solution

Ayn
Legend

There are ways to do this that require some messing around with on-the-fly transforming of the source value, but I wonder if you really need that? You can easily put a wildcard at the end when you search for the sources in the directory you're interested in, like so:

source="/the/directory/containing/apachelogs/*"

View solution in original post

Ayn
Legend

There are ways to do this that require some messing around with on-the-fly transforming of the source value, but I wonder if you really need that? You can easily put a wildcard at the end when you search for the sources in the directory you're interested in, like so:

source="/the/directory/containing/apachelogs/*"

Ayn
Legend

No problem. Could you please mark my answer as accepted? Thanks!

0 Karma

stwong
Communicator

thanks a lot.

0 Karma
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...

Updated Data Management and AWS GDI Inventory in Splunk Observability

We’re making some changes to Data Management and Infrastructure Inventory for AWS. The Data Management page, ...