Dashboards & Visualizations

How to addterm to search using two form fields

hiddenkirby
Contributor

So i have a static select of values.. and an ExtendedFieldSearch text form field...

i would like to "addterm" to a hidden search.

my search string would be "index=myindex thestaticselectedvalue=theformfieldentry"

I am using the following but can't seem to get the form field's entry into the value (keeps passing null)

<module name"ConvertToIntention">
  <param name="intention">
   <param name="name">addterm</param>
   <param name="arg">
     <param name="$staticselectedvalue$">$theformfieldentry$</param>
   </param>
  </param>
 <module name="HiddenSearch>
 ... 

I always get "index=myindex staticselectedvalue=null"

halp!

TIA, Kirby

0 Karma
1 Solution

gkanapathy
Splunk Employee
Splunk Employee

ExtendedFieldSearch does not create a "setting" (which is what is "converted" from when you use "ConvertToIntention". Instead, it creates an intention directly. You would need to define the intention in the ExtendedFieldSearch. The problem you'll have is if you're trying to "re-use" the intention, e.g. in clickthrus after it was "consumed" by a search, you won't have a "setting" to re-create the intention from. If this is the case, you'd have to use "TextSetting" instead, though this is different and missing functions that ExtendedFieldSearch provides.

View solution in original post

gkanapathy
Splunk Employee
Splunk Employee

ExtendedFieldSearch does not create a "setting" (which is what is "converted" from when you use "ConvertToIntention". Instead, it creates an intention directly. You would need to define the intention in the ExtendedFieldSearch. The problem you'll have is if you're trying to "re-use" the intention, e.g. in clickthrus after it was "consumed" by a search, you won't have a "setting" to re-create the intention from. If this is the case, you'd have to use "TextSetting" instead, though this is different and missing functions that ExtendedFieldSearch provides.

hiddenkirby
Contributor

this is helpful. i removed the "addterm" piece of code all together and added $staticselectvalue$=$formfieldvalue$ to my search string ... and it seems to only be passing default.. no matter what i type in. either way this is helpful and thank you.

0 Karma
Get Updates on the Splunk Community!

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...