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!

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 ...

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...