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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...