Knowledge Management

How to change the output of a textbox based on user input and use it in search?


I have two textboxes i) holds the keyword ii) hosts the exact flag

If user adds 0 in exact keyword flag - The the search should show the keyword added in first textbox as *keyword* otherwise it should show simply keyword. I tried Macro but it didn't work. Any ideas?

  <label>Test Dashboard</label>
  <fieldset submitButton="false">
    <input type="text" token="kwsearch">
    <input type="text" token="exact">
          <query>|makeresults | fields - _time | eval Result = `make_keyword($kwsearch$, $exact$)`</query>
        <option name="count">10</option>
        <option name="drilldown">none</option>
        <option name="refresh.display">progressbar</option>

My Macro is:
defined as:


Tags (2)
0 Karma


Hello @nabeel652,

I just testet your dashboard. I believe the root of your troubles are missing quotation marks.

This will NOT work:

| makeresults | eval Result=test

This will also NOT work:

| makeresults | eval Result="\""+test+"\""

I got it working by putting quotation marks around $kwsearch$ without using a macro:

<query>|makeresults | fields - _time | eval Result=if($exact$==0,"\"$kwsearch$\"","$kwsearch$")</query>
0 Karma
Get Updates on the Splunk Community!

Routing Data to Different Splunk Indexes in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. The OpenTelemetry project is the second largest ...

Getting Started with AIOps: Event Correlation Basics and Alert Storm Detection in ...

Getting Started with AIOps:Event Correlation Basics and Alert Storm Detection in Splunk IT Service ...

Register to Attend BSides SPL 2022 - It's all Happening October 18!

Join like-minded individuals for technical sessions on everything Splunk!  This is a community-led and run ...