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!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...