Splunk Search

Adding source path to table output

tom1981
Engager

I have the following search set up:

search string
| fields host raw
| fields - _time _indextime _sourcetype _subsecond _serial _bkt _cd _si _kv _timediff | head 1
| join append [ stats count | fields - count ]
| eval SourcePath=WHAT TO PUT HERE?
| eval ConfigItem="Config Item"
| eval PAGER="Pager"
| eval TEAM="Team"

| eval GROUP="Group"
| eval SHORTDESCRIPTION="Short Description"
| table host _raw SourcePath Config.Item PAGER TEAM GROUP SHORTDESCRIPTION
| rex mode=sed "s/\,//g"
| rex mode=sed "s/[^a-zA-Z0-9
-.]+/ /g"
| outputcsv file.csv

Everything is working as required, I am just not too sure what should I match eval SourcePath= with in order to obtain the string of the source log file's path?
Anyone able to assist?

Thanks a bunch!
Tom

0 Karma

tom1981
Engager

Events:

Before formatting;
alt text

After formating:
alt text

0 Karma

richgalloway
SplunkTrust
SplunkTrust

It's difficult to answer without knowing your data. Please share some sample (sanitized) events.

---
If this reply helps you, Karma would be appreciated.
0 Karma

tom1981
Engager

Hello,

Sorry for the delay.
Please see in the answer section for the event examples (cannot add pictures here)

Thanks a lot!

0 Karma

tom1981
Engager

Bump to top.

0 Karma
Get Updates on the Splunk Community!

Technical Workshop Series: Splunk Data Management and SPL2 | Register here!

Hey, Splunk Community! Ready to take your data management skills to the next level? Join us for a 3-part ...

Spotting Financial Fraud in the Haystack: A Guide to Behavioral Analytics with Splunk

In today's digital financial ecosystem, security teams face an unprecedented challenge. The sheer volume of ...

Solve Problems Faster with New, Smarter AI and Integrations in Splunk Observability

Solve Problems Faster with New, Smarter AI and Integrations in Splunk Observability As businesses scale ...