<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to use TimePicker on CSV in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-TimePicker-on-CSV/m-p/190818#M54923</link>
    <description>&lt;P&gt;Hi,&lt;BR /&gt;
I have a csv file as shown below:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;CODE&gt;DATE      VALUE&lt;BR /&gt;
    1-Jan      2&lt;BR /&gt;
    02-Jan    3&lt;BR /&gt;
    04-Jan    5&lt;BR /&gt;
    05-Jan      4&lt;BR /&gt;
    06-Jan    7&lt;BR /&gt;
    07-Jan    88&lt;BR /&gt;
    08-Jan      09&lt;BR /&gt;
    09-Jan    77&lt;BR /&gt;
    10-Jan    7 &lt;BR /&gt;
    11-Jan    66&lt;BR /&gt;
    12-Jan    34&lt;BR /&gt;
    13-Jan    234&lt;BR /&gt;
    14-Jan    23&lt;BR /&gt;
    15-Jan    4&lt;BR /&gt;
    16-Jan      4&lt;BR /&gt;
&lt;/CODE&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;I am creating a dashboard with time picker, where result is shown as per my time range selection.&lt;BR /&gt;
I have used following xml code for the same.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; &amp;lt;form&amp;gt;
     &amp;lt;label&amp;gt;Timechart for drilldown&amp;lt;/label&amp;gt;
     &amp;lt;fieldset autoRun="true" submitButton="false"&amp;gt;
     &amp;lt;input type="time" searchWhenChanged="true" token="dashboardTime"&amp;gt;
       &amp;lt;default&amp;gt;
         &amp;lt;earliestTime&amp;gt;&amp;lt;/earliestTime&amp;gt;
         &amp;lt;latestTime&amp;gt;now&amp;lt;/latestTime&amp;gt;
       &amp;lt;/default&amp;gt;
     &amp;lt;/input&amp;gt;
     &amp;lt;/fieldset&amp;gt;
     &amp;lt;row&amp;gt;
     &amp;lt;chart&amp;gt;
       &amp;lt;searchString&amp;gt;|inputcsv NETWORK.csv|eval _time=strptime(DATE,"%d-%b")|table _time VALUE&amp;lt;/searchString&amp;gt;
       &amp;lt;earliestTime&amp;gt;$dashboardTime.earliest$&amp;lt;/earliestTime&amp;gt;
       &amp;lt;latestTime&amp;gt;$dashboardTime.latest$&amp;lt;/latestTime&amp;gt;
       &amp;lt;option name="charting.chart"&amp;gt;column&amp;lt;/option&amp;gt;
       &amp;lt;option name="charting.chart.nullValueMode"&amp;gt;gaps&amp;lt;/option&amp;gt;
       &amp;lt;option name="charting.drilldown"&amp;gt;all&amp;lt;/option&amp;gt;
     &amp;lt;/chart&amp;gt;
     &amp;lt;/row&amp;gt;
 &amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;No matter what I select, the complete result like 1-Jan to 16-Jan is always displayed in dashboard.&lt;BR /&gt;
What wrong I am doing here.&lt;BR /&gt;
Please Help...!!!&lt;/P&gt;</description>
    <pubDate>Fri, 20 Mar 2015 15:53:45 GMT</pubDate>
    <dc:creator>harshal_chakran</dc:creator>
    <dc:date>2015-03-20T15:53:45Z</dc:date>
    <item>
      <title>How to use TimePicker on CSV</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-TimePicker-on-CSV/m-p/190818#M54923</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
I have a csv file as shown below:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;CODE&gt;DATE      VALUE&lt;BR /&gt;
    1-Jan      2&lt;BR /&gt;
    02-Jan    3&lt;BR /&gt;
    04-Jan    5&lt;BR /&gt;
    05-Jan      4&lt;BR /&gt;
    06-Jan    7&lt;BR /&gt;
    07-Jan    88&lt;BR /&gt;
    08-Jan      09&lt;BR /&gt;
    09-Jan    77&lt;BR /&gt;
    10-Jan    7 &lt;BR /&gt;
    11-Jan    66&lt;BR /&gt;
    12-Jan    34&lt;BR /&gt;
    13-Jan    234&lt;BR /&gt;
    14-Jan    23&lt;BR /&gt;
    15-Jan    4&lt;BR /&gt;
    16-Jan      4&lt;BR /&gt;
&lt;/CODE&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;I am creating a dashboard with time picker, where result is shown as per my time range selection.&lt;BR /&gt;
I have used following xml code for the same.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; &amp;lt;form&amp;gt;
     &amp;lt;label&amp;gt;Timechart for drilldown&amp;lt;/label&amp;gt;
     &amp;lt;fieldset autoRun="true" submitButton="false"&amp;gt;
     &amp;lt;input type="time" searchWhenChanged="true" token="dashboardTime"&amp;gt;
       &amp;lt;default&amp;gt;
         &amp;lt;earliestTime&amp;gt;&amp;lt;/earliestTime&amp;gt;
         &amp;lt;latestTime&amp;gt;now&amp;lt;/latestTime&amp;gt;
       &amp;lt;/default&amp;gt;
     &amp;lt;/input&amp;gt;
     &amp;lt;/fieldset&amp;gt;
     &amp;lt;row&amp;gt;
     &amp;lt;chart&amp;gt;
       &amp;lt;searchString&amp;gt;|inputcsv NETWORK.csv|eval _time=strptime(DATE,"%d-%b")|table _time VALUE&amp;lt;/searchString&amp;gt;
       &amp;lt;earliestTime&amp;gt;$dashboardTime.earliest$&amp;lt;/earliestTime&amp;gt;
       &amp;lt;latestTime&amp;gt;$dashboardTime.latest$&amp;lt;/latestTime&amp;gt;
       &amp;lt;option name="charting.chart"&amp;gt;column&amp;lt;/option&amp;gt;
       &amp;lt;option name="charting.chart.nullValueMode"&amp;gt;gaps&amp;lt;/option&amp;gt;
       &amp;lt;option name="charting.drilldown"&amp;gt;all&amp;lt;/option&amp;gt;
     &amp;lt;/chart&amp;gt;
     &amp;lt;/row&amp;gt;
 &amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;No matter what I select, the complete result like 1-Jan to 16-Jan is always displayed in dashboard.&lt;BR /&gt;
What wrong I am doing here.&lt;BR /&gt;
Please Help...!!!&lt;/P&gt;</description>
      <pubDate>Fri, 20 Mar 2015 15:53:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-TimePicker-on-CSV/m-p/190818#M54923</guid>
      <dc:creator>harshal_chakran</dc:creator>
      <dc:date>2015-03-20T15:53:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to use TimePicker on CSV</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-TimePicker-on-CSV/m-p/190819#M54924</link>
      <description>&lt;P&gt;The problem is that your search doesn't evaluate what _time should be until AFTER your dashboard has applied the time to the search.  With how this is built, the search is effectively:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search earliest=$dashboardTime.earliest$ latest=$dashboardTime.latest$ | inputcsv NETWORK.csv | ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So what you need to do is explicitly put the time filtering AFTER the inputcsv.  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;      &amp;lt;chart&amp;gt;
        &amp;lt;searchString&amp;gt;|inputcsv NETWORK.csv|eval _time=strptime(DATE,"%d-%b")| search earliest=$dashboardTime.earliest$ latest=$dashboardTime.latest$ | table _time VALUE&amp;lt;/searchString&amp;gt;
        &amp;lt;option name="charting.chart"&amp;gt;column&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.nullValueMode"&amp;gt;gaps&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.drilldown"&amp;gt;all&amp;lt;/option&amp;gt;
      &amp;lt;/chart&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 20 Mar 2015 15:57:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-TimePicker-on-CSV/m-p/190819#M54924</guid>
      <dc:creator>emiller42</dc:creator>
      <dc:date>2015-03-20T15:57:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to use TimePicker on CSV</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-TimePicker-on-CSV/m-p/190820#M54925</link>
      <description>&lt;P&gt;I think you are assuming that the date that you have in your first column is going to be the date that it will use for the event, which is not the case because it is not a complete date. It is going to use the date of the file or the date of indexing, depending on the way you are putting the data into Splunk.&lt;/P&gt;

&lt;P&gt;Use a complete date in the column and you might get the results you are expecting. A date like "01-Jan-15 00:00:00" is a complete date and Splunk will respect the date for the event (read: line or row).&lt;/P&gt;

&lt;P&gt;With a proper date, then timestamp for the row will be able to be used with the timepicker because the event &lt;CODE&gt;_time&lt;/CODE&gt; will match the data on the row.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Mar 2015 16:03:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-TimePicker-on-CSV/m-p/190820#M54925</guid>
      <dc:creator>cpetterborg</dc:creator>
      <dc:date>2015-03-20T16:03:59Z</dc:date>
    </item>
  </channel>
</rss>

