Dashboards & Visualizations

Date Picker in Simple XML

lahariveerlapat
Explorer

My requirement is to pick a single date rather than selecting the Date Range in Time Range Picker Or Date Range to select as default in Time Range Picker
Any suggestions plz.....

0 Karma

sloshburch
Splunk Employee
Splunk Employee

If you haven't seen it, http://docs.splunk.com/Documentation/Splunk/latest/Admin/Timesconf might be of use to you.

On the other hand, you can create an input that defines a token you can use as the values for earliest and latest in the search string.

If you provide more detail or an example of what you're trying to do, we can provide a more effectives solution/recommendation.

0 Karma

mnatkin_splunk
Splunk Employee
Splunk Employee

The way I handled this recently was to forego the time picker and use a multi-select in concert with the automagic "date" field. Note: I've limited the date picker here to the last 15 days, so as not to overtax the SH. Adjust the parameter to meet your needs.

<input type="multiselect" token="DATE_tok" searchWhenChanged="true">
      <label>Date</label>
      <choice value="*">Any</choice>
      <prefix>(</prefix>
      <suffix>)</suffix>
      <valuePrefix>date="</valuePrefix>
      <valueSuffix>"</valueSuffix>
      <delimiter> OR </delimiter>
      <fieldForLabel>date</fieldForLabel>
      <fieldForValue>date</fieldForValue>
      <search>
        <query>sourcetype="SplunkNinjaDataSource" | stats count by date</query>
       <earliest>-15d@h</earliest>
       <latest>now</latest>
      </search>
    </input>

Just add the token $DATE_tok$ into your search, and you're off to the races.

HTH

intelsubham
Explorer

If you select same date in both textboxes , it is automatically equivalent to 1 day. i.e. if you are selecting 05/27/2015 in both text boxes, it actually means 05/27/2015 (00:00:00) to 05/27/2015 (24:00:00).
As of now, I think there are not any available parameters under timerangepicker module which can help us achieving this.

0 Karma

splunk_mkhan
Explorer

I am looking for same.
Want to create a calendar date picker field in setup.xml.

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...