Dashboards & Visualizations

How do you search with value and changed value?

patsta_g
Engager

I have a form with a text field (strfield1), values like '98.12.123456.12345678'.

I need to search with the value of this field (strfield1) and a second value of this field without points ('980012345612345678')

Where/How in the XML can i create a string like:
strfield1b = replace($strfield1$,".","")
so I can search like
index=x AND (Identcode=$strfield1$ OR Identcode=$strfield1b$

0 Karma
1 Solution

renjith_nair
Legend

@patsta_g ,

Try

    <input type="text" token="strfield1">
      <label>Identcode</label>
      <change>
        <eval token="strfield1b">replace($value$,"\\.","")</eval>
      </change>
    </input>
Happy Splunking!

View solution in original post

renjith_nair
Legend

@patsta_g ,

Try

    <input type="text" token="strfield1">
      <label>Identcode</label>
      <change>
        <eval token="strfield1b">replace($value$,"\\.","")</eval>
      </change>
    </input>
Happy Splunking!

patsta_g
Engager

I added "\" - and the everything is fine! 🙂
thanks a lot!

0 Karma

p_gurav
Champion

Hi patsta_g,

You can use token, Please check below code I tested with some sample values:

<form>
  <label>test_text_filter</label>
  <fieldset submitButton="true" autoRun="false">
    <input type="text" token="field1" searchWhenChanged="true">
      <label>Text</label>
      <change>
        <eval token="abc">replace($field1$,"-","")</eval>
      </change>
    </input>
  </fieldset>
  <row>
    <panel>
      <table>
        <search>
          <query>| makeresults | eval host="ip-1-2-3-4,test-interview,testinterview" | makemv delim="," host| mvexpand host | search host=$field1$ OR host="$abc$"</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
          <sampleRatio>1</sampleRatio>
        </search>
        <option name="count">20</option>
        <option name="dataOverlayMode">none</option>
        <option name="drilldown">none</option>
        <option name="percentagesRow">false</option>
        <option name="rowNumbers">false</option>
        <option name="totalsRow">false</option>
        <option name="wrap">true</option>
      </table>
    </panel>
  </row>
</form>
0 Karma
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...