Splunk Search

set a value at search time

sbsbb
Builder

I made a Union with APPEND betwenn to search :

search1 APPEND [search2]

I want to have a field "source" that has a specific value, depending from the source query is there a way to do somthing like :

search1 source=1 | APPEND [search2 source=2]

and to have results like :

field1, field2, 1 (when comming from source1)
field1, field2, 2 (when comming from source2)

?

0 Karma
1 Solution

Ayn
Legend

Ayn
Legend

Sure. Have a look at eval which will do what you want.

http://docs.splunk.com/Documentation/Splunk/5.0/SearchReference/Eval

sbsbb
Builder

that exactly what I needed thank you

0 Karma
Get Updates on the Splunk Community!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

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