Dashboards & Visualizations

ConvertToIntention - Pass addterm to two locations in search

seancblake
Engager

I'm looking to perform an addterm on a saved search that has a subsearch. I need the value from the addterm passed into both locations. Is there a way to do this with the "flags" option?

index=ems sourcetype="perfmon:perfmon:sqls*" counter="Lazy writes/sec" earliest=@d ADDTERMHERE | timechart partial=f span=30m avg(Value) as LazyWrites | eval marker = "Today" | eval _time = _time+1800 | append [search index=ems sourcetype=perfmon:perfmon:sqls* counter="Laxy writes/sec" earliest=-7d@d-30m latest=-6d@d-30m ANDADDTERMHERE | timechart span=30m avg(Value) as LazyWrites | eval marker = "Same Day Last Week" | eval _time = _time+86400*7+1800 ] | timechart span=30m values(LazyWrites) as "Lazy Writes" by marker

My intention looks like so:

<module name="ConvertToIntention">
   <param name="settingToConvert">host_setting</param>
   <param name="intention">
     <param name="name">addterm</param>
     <param name="arg">
        <param name="host">$target$</param>
      </param>
      <param name="flags"><list>indexed</list></param>
   </param> 

Thanks!

sideview
SplunkTrust
SplunkTrust

You can't do it with addterm I'm afraid. Addterm intentions cannot add things into subsearches. Which leaves

a) the 'stringreplace' intention, and you can find some examples of this usage in the UI Examples app.

b) take a look at Sideview Utils which does away with the whole idea of intentions and allows you to plug form element values directly into searches as straight $foo$ tokens. (Full disclosure: i am the creator of Sideview Utils)

Get Updates on the Splunk Community!

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

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...