Splunk Search

How to use Collect to push the Host, Source and Sourcetype from the Original index ?

sagrl
Explorer

I want to use the collect command and want to push the Host, source and source-type coming from the Original index.

index=sm sourcetype=mysqld 
| eval host1=host 
| eval index1=index 
| eval sourcetype1=sourcetype 
| eval source1=source 
| collect index="test" source=source1

It is pushing "source1" string instead of its actual value any idea how to send the actual dynamic value ?

Tags (1)
0 Karma

FrankVl
Ultra Champion

host, source and sourcetype attributes of the collect command are string attributes, so I don't think you can put field references in there. Doesn't collect retain the existing host and source values anyway? Sourcetype will be changed to stash by default.

0 Karma
Get Updates on the Splunk Community!

Your Guide to Splunk Digital Experience Monitoring

A flawless digital experience isn't just an advantage, it's key to customer loyalty and business success. But ...

Data Management Digest – November 2025

  Welcome to the inaugural edition of Data Management Digest! As your trusted partner in data innovation, the ...

Upcoming Webinar: Unmasking Insider Threats with Slunk Enterprise Security’s UEBA

Join us on Wed, Dec 10. at 10AM PST / 1PM EST for a live webinar and demo with Splunk experts! Discover how ...