Splunk Search

Dashboard : Input's searches produce no results

DjNaGuRo
Explorer

Hi everyone,

I've an issue that I don't understand. As mentioned in subject, I'm realizing a dashboard with dropdown inputs where I'm using id and base attribute but my searches don't return any result.

Notice that the last index time of my data is 06 july 2021.

Here's the xml code of my dashboard. Thanks in advance for your kindly help!

 

 

<form theme="dark">
  <label>Advanced Dashboard</label>
  <description>This is a dasboard build for learning purpose.</description>
  <search id="base_search">
    <query>index=splunk_tutorial sourcetype="access_combined_wcookie" status=200 earliest=1</query>
  </search>
  <fieldset submitButton="false">
    <input type="dropdown" token="date_year" searchWhenChanged="true">
      <label>field1</label>
      <choice value="*">All</choice>
      <default>*</default>
      <fieldForLabel>date_year</fieldForLabel>
      <fieldForValue>date_year</fieldForValue>
      <search base="base_search">
        <query>| stats count by date_year</query>
      </search>
    </input>
    <input type="dropdown" token="date_month" searchWhenChanged="true">
      <label>field1</label>
      <choice value="*">All</choice>
      <default>*</default>
      <fieldForLabel>date_month</fieldForLabel>
      <fieldForValue>date_month</fieldForValue>
      <search base="base_search">
        <query>| stats count by date_month</query>
      </search>
    </input>
    <input type="dropdown" token="date_mday" searchWhenChanged="true">
      <label>Days of Month</label>
      <choice value="*">All</choice>
      <default>*</default>
      <fieldForLabel>date_mday</fieldForLabel>
      <fieldForValue>date_mday</fieldForValue>
      <search base="base_search">
        <query>| stats count by date_mday</query>
      </search>
    </input>
    <input type="dropdown" token="date_wday" searchWhenChanged="true">
      <label>Week days</label>
      <choice value="*">All</choice>
      <default>*</default>
      <fieldForLabel>date_wday</fieldForLabel>
      <fieldForValue>date_wday</fieldForValue>
      <search base="base_search">
        <query>| stats count by date_wday</query>
      </search>
    </input>
    <input type="dropdown" token="date_hour" searchWhenChanged="true">
      <label>Hours</label>
      <choice value="*">All</choice>
      <default>*</default>
      <fieldForLabel>date_hour</fieldForLabel>
      <fieldForValue>date_hour</fieldForValue>
      <search base="base_search">
        <query>| stats count by date_hour</query>
      </search>
    </input>
    <input type="dropdown" token="country" searchWhenChanged="true">
      <label>Countries</label>
      <choice value="*">All</choice>
      <default>*</default>
      <fieldForLabel>Country</fieldForLabel>
      <fieldForValue>Country</fieldForValue>
      <search base="base_search">
        <query>| iplocation clientip | stats count by Country</query>
      </search>
    </input>
  </fieldset>
</form>

 

 

0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

The dashboard has no panels so, naturally, it won't display any data.

The base search covers all time, something that usually is discouraged, but since this is for training it should be OK.

The reason the dropdowns don't populate is because the base search is not transforming.  The easiest way to make it transforming is to add a fields command.

index=splunk_tutorial sourcetype="access_combined_wcookie" status=200 earliest=1 | fields clientip date_*

See https://docs.splunk.com/Documentation/Splunk/8.2.1/Viz/Savedsearches#Post-process_searches_2 for more about base searches and post-processing.

---
If this reply helps you, Karma would be appreciated.

View solution in original post

0 Karma

richgalloway
SplunkTrust
SplunkTrust

The dashboard has no panels so, naturally, it won't display any data.

The base search covers all time, something that usually is discouraged, but since this is for training it should be OK.

The reason the dropdowns don't populate is because the base search is not transforming.  The easiest way to make it transforming is to add a fields command.

index=splunk_tutorial sourcetype="access_combined_wcookie" status=200 earliest=1 | fields clientip date_*

See https://docs.splunk.com/Documentation/Splunk/8.2.1/Viz/Savedsearches#Post-process_searches_2 for more about base searches and post-processing.

---
If this reply helps you, Karma would be appreciated.
0 Karma

DjNaGuRo
Explorer

Thanks for your help 😊

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!

What Is Splunk? Here’s What You Can Do with Splunk

Hey Splunk Community, we know you know Splunk. You likely leverage its unparalleled ability to ingest, index, ...

Level Up Your .conf25: Splunk Arcade Comes to Boston

With .conf25 right around the corner in Boston, there’s a lot to look forward to — inspiring keynotes, ...

Manual Instrumentation with Splunk Observability Cloud: How to Instrument Frontend ...

Although it might seem daunting, as we’ve seen in this series, manual instrumentation can be straightforward ...