Splunk Search

Why does Dashboard Classic not return result even though "Open in search" does?

yuanliu
SplunkTrust
SplunkTrust

Here is a really simple dashboard:

 

<form version="1.1" theme="light">
  <label>Simple input</label>
  <fieldset submitButton="false">
    <input type="text" token="text_tok" searchWhenChanged="true">
      <label></label>
      <default></default>
    </input>
  </fieldset>
  <row>
    <panel>
      <event>
        <search>
          <query>| makeresults
| eval INPUT = if(len("$text_tok$") &gt;0, "$text_tok$", "(none)")</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
        </search>
        <option name="list.drilldown">none</option>
        <option name="refresh.display">progressbar</option>
      </event>
    </panel>
  </row>
</form>

 

Its function is really simple: When nothing is entered into the text input, display something like

INPUT_time
(none)2024-09-28 17:33:54

Indeed, when I click the magnifying glass ("Open in search"), that's what I get

noinput.png

If any string is entered, that string will be displayed.  For example, if a single letter "a" is entered, it should display

INPUT_time
a2024-09-28 17:31:31

Just as well, "Open in search" gives this output

ainput.png

However, no matter what is entered or not entered, the dashboard panel always says "Search did not return any events."

noinput-dash.png

ainput-dash.png

Test is done in Splunk 9.3.0. 

Tags (1)
0 Karma
1 Solution

yuanliu
SplunkTrust
SplunkTrust

The problem is in visualization type <event />.  Even though makeresults is a generative command, there is no real event.  Switch to <table /> visualization and the dashboard functions as expected.

 

<form version="1.1" theme="light">
  <label>Simple input</label>
  <fieldset submitButton="false">
    <input type="text" token="text_tok" searchWhenChanged="true">
      <label></label>
      <default></default>
    </input>
  </fieldset>
  <row>
    <panel>
      <table>
        <search>
          <query>| makeresults
| eval INPUT = if(len("$text_tok$") &gt;0, "$text_tok$", "(none)")</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
        </search>
        <option name="drilldown">cell</option>
        <option name="refresh.display">progressbar</option>
      </table>
    </panel>
  </row>
</form>

noinput-good.png

ainput-good.png

 

 

View solution in original post

Tags (1)
0 Karma

yuanliu
SplunkTrust
SplunkTrust

The problem is in visualization type <event />.  Even though makeresults is a generative command, there is no real event.  Switch to <table /> visualization and the dashboard functions as expected.

 

<form version="1.1" theme="light">
  <label>Simple input</label>
  <fieldset submitButton="false">
    <input type="text" token="text_tok" searchWhenChanged="true">
      <label></label>
      <default></default>
    </input>
  </fieldset>
  <row>
    <panel>
      <table>
        <search>
          <query>| makeresults
| eval INPUT = if(len("$text_tok$") &gt;0, "$text_tok$", "(none)")</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
        </search>
        <option name="drilldown">cell</option>
        <option name="refresh.display">progressbar</option>
      </table>
    </panel>
  </row>
</form>

noinput-good.png

ainput-good.png

 

 

Tags (1)
0 Karma
Get Updates on the Splunk Community!

Aligning Observability Costs with Business Value: Practical Strategies

 Join us for an engaging Tech Talk on Aligning Observability Costs with Business Value: Practical ...

Mastering Data Pipelines: Unlocking Value with Splunk

 In today's AI-driven world, organizations must balance the challenges of managing the explosion of data with ...

Splunk Up Your Game: Why It's Time to Embrace Python 3.9+ and OpenSSL 3.0

Did you know that for Splunk Enterprise 9.4, Python 3.9 is the default interpreter? This shift is not just a ...