Splunk Search

Search by source name in virtual index does not show results

sdaruna
Explorer

Hi,

i need to get the raw data of file based on source file name. For that i have used below query.

source="xml_file_1.xml" | table _raw

This is giving results only for local indexes, but not the virtual indexes.
I tried below queries as well,

index ="hdfs_index" | search source="xml_file_1.xml" | table _raw
index ="hdfs_index" WHERE source="xml_file_1.xml" | table _raw

But, none has given results.
What went wrong.

Is there a way that i can match the source file name.?

Tags (1)
0 Karma

javiergn
Super Champion

What about the following using a wildcard for your source?

index ="hdfs_index" source="*xml_file_1.xml" | table _raw

Apologies if I'm missing something here.

0 Karma

sdaruna
Explorer

In fact, i missed a point here. The source will be name in virtual indexes will have full path.

I tried below one and worked.

index="hdfs_index" | eval source = replace(source, ".*/", "") | search source="xml_file_0.xml" | table _raw

0 Karma
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...