Splunk Search

Can I do an eval on static values of an input?

jiaqya
Builder

i have an input where I choose some values, based on which i want another input value to be calculated.

Can I do an eval on an input ( static/dynamic)?

Tags (2)
0 Karma

niketn
Legend

@jiagya you can use <eval> to set required token on input <change> event handler, where predefined tokens $value$ and $label$ can be used to access input's value and Label respectively. Refer to documentation: http://docs.splunk.com/Documentation/Splunk/latest/Viz/tokens#Define_token_filtering_and_formatting

<input type="text" token="someToken">
  <label>Some Field Name</label>
  <change>
    <eval token="tokNewValue">"Something New".$value$</eval>
   </change>
 .....
____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

jiaqya
Builder

Thanks Niket, but i did not get the gist of it.

i have a input dropdown, where i select a value , ex: 30
then i want to calculate 30*something for example in another input filter

i am able to print the value on the new input filter, but unable to do calculations, its giving me error.

could not upload the screenshot

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...