<?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 Re: Search data for All Time but only graph a specified time range in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Search-data-for-All-Time-but-only-graph-a-specified-time-range/m-p/309906#M92997</link>
    <description>&lt;P&gt;_time is an integer.  The last clause of the &lt;CODE&gt;case&lt;/CODE&gt; sets _time to "show_date=October", which is not an integer.  Try &lt;CODE&gt;... | eval _time=case(STATUS="Open", FAILURE_DATE, STATUS="Closed", CLOSED_DATE, 1==1, show_date) | ...&lt;/CODE&gt;.&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 16:17:20 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2020-09-29T16:17:20Z</dc:date>
    <item>
      <title>Search data for All Time but only graph a specified time range</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-data-for-All-Time-but-only-graph-a-specified-time-range/m-p/309901#M92992</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I am charting IT help desk tickets and I need to make a chart showing how many tickets are opened and closed every month. The timestamp for _time is the ticket failure_date. To accurately reflect how many tickets are closed per month I need to search "All_Time" so if a ticket were opened in say December 2016 and then closed in March 2017 it'll be captured in the graph.&lt;/P&gt;

&lt;P&gt;Now I can get all the data to graph but I would like to only graph select months if possible. Below is the current search I am using:&lt;/P&gt;

&lt;P&gt;sourcetype=Current_file&lt;BR /&gt;
| where STATUS != "DRAFT" &lt;BR /&gt;
| eval FAILURE_DATE=strptime(FAILURE_DATE, "%m/%d/%Y %H:%M") &lt;BR /&gt;
| eval CLOSED_DATE=strptime(CLOSED_DATE, "%m/%d/%Y %H:%M") &lt;BR /&gt;
| eval STATUS=mvappend("Open","Closed")&lt;BR /&gt;
| mvexpand STATUS&lt;BR /&gt;
| eval _time=case(STATUS="Open", FAILURE_DATE, STATUS="Closed", CLOSED_DATE)&lt;BR /&gt;
| timechart span=1mon count by STATUS&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:16:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-data-for-All-Time-but-only-graph-a-specified-time-range/m-p/309901#M92992</guid>
      <dc:creator>kyule</dc:creator>
      <dc:date>2020-09-29T16:16:21Z</dc:date>
    </item>
    <item>
      <title>Re: Search data for All Time but only graph a specified time range</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-data-for-All-Time-but-only-graph-a-specified-time-range/m-p/309902#M92993</link>
      <description>&lt;P&gt;I think this will work for you, but you will probably want to change something to make the timechart more interesting...&lt;/P&gt;

&lt;P&gt;sourcetype=Current_file&lt;BR /&gt;
| where STATUS != "DRAFT" &lt;BR /&gt;
| eval FAILURE_DATE=strptime(FAILURE_DATE, "%m/%d/%Y %H:%M") &lt;BR /&gt;
| eval CLOSED_DATE=strptime(CLOSED_DATE, "%m/%d/%Y %H:%M")&lt;BR /&gt;
| eval show_date=strftime(strptime(CLOSED_DATE,"%Y/%m/%d"),"%m")&lt;BR /&gt;
| eval STATUS=mvappend("Open","Closed")&lt;BR /&gt;
| mvexpand STATUS&lt;BR /&gt;
| eval _time=case(STATUS="Open", FAILURE_DATE, STATUS="Closed", CLOSED_DATE, show_date=X)&lt;BR /&gt;
| timechart span=1mon count by STATUS&lt;/P&gt;

&lt;P&gt;Replace the "X" in "show_date=X" with the month you wish to display&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:19:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-data-for-All-Time-but-only-graph-a-specified-time-range/m-p/309902#M92993</guid>
      <dc:creator>mydog8it</dc:creator>
      <dc:date>2020-09-29T16:19:50Z</dc:date>
    </item>
    <item>
      <title>Re: Search data for All Time but only graph a specified time range</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-data-for-All-Time-but-only-graph-a-specified-time-range/m-p/309903#M92994</link>
      <description>&lt;P&gt;Thank you for the reply Mydog8it, but I am getting the following error when using that:&lt;BR /&gt;
&lt;STRONG&gt;Error in 'eval' command: The arguments to the 'case' function are invalid.&lt;/STRONG&gt; &lt;/P&gt;

&lt;P&gt;To clarify when I entered month I used decimals, and then spelled out the month.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2017 23:58:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-data-for-All-Time-but-only-graph-a-specified-time-range/m-p/309903#M92994</guid>
      <dc:creator>kyule</dc:creator>
      <dc:date>2017-10-17T23:58:38Z</dc:date>
    </item>
    <item>
      <title>Re: Search data for All Time but only graph a specified time range</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-data-for-All-Time-but-only-graph-a-specified-time-range/m-p/309904#M92995</link>
      <description>&lt;P&gt;Try this.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval _time=case(STATUS="Open", FAILURE_DATE, STATUS="Closed", CLOSED_DATE, 1==1, show_date=X) | ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Oct 2017 12:48:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-data-for-All-Time-but-only-graph-a-specified-time-range/m-p/309904#M92995</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2017-10-18T12:48:01Z</dc:date>
    </item>
    <item>
      <title>Re: Search data for All Time but only graph a specified time range</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-data-for-All-Time-but-only-graph-a-specified-time-range/m-p/309905#M92996</link>
      <description>&lt;P&gt;Thank you Rich,&lt;/P&gt;

&lt;P&gt;Thank you very much for the suggestion, it does get rid of the error I was having with just using "show_date=X", but when I enter a date the search still graphs "All_time" rather than the specified month in "show_date=X". Actually it's rather odd no matter what value I put into "show_date=x" Splunk returns with "All_time" graphed data. &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:16:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-data-for-All-Time-but-only-graph-a-specified-time-range/m-p/309905#M92996</guid>
      <dc:creator>kyule</dc:creator>
      <dc:date>2020-09-29T16:16:40Z</dc:date>
    </item>
    <item>
      <title>Re: Search data for All Time but only graph a specified time range</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-data-for-All-Time-but-only-graph-a-specified-time-range/m-p/309906#M92997</link>
      <description>&lt;P&gt;_time is an integer.  The last clause of the &lt;CODE&gt;case&lt;/CODE&gt; sets _time to "show_date=October", which is not an integer.  Try &lt;CODE&gt;... | eval _time=case(STATUS="Open", FAILURE_DATE, STATUS="Closed", CLOSED_DATE, 1==1, show_date) | ...&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:17:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-data-for-All-Time-but-only-graph-a-specified-time-range/m-p/309906#M92997</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-09-29T16:17:20Z</dc:date>
    </item>
    <item>
      <title>Re: Search data for All Time but only graph a specified time range</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-data-for-All-Time-but-only-graph-a-specified-time-range/m-p/309907#M92998</link>
      <description>&lt;P&gt;Good morning Rich,&lt;/P&gt;

&lt;P&gt;I'm still getting data graphed over "All_time". I think I may try and separate the search into an open and a close and then try to join them or appendcols...and re-index the .csv file to use indexed time as the _time rather than Failure_Date.&lt;/P&gt;

&lt;P&gt;Thank you for the help.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:21:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-data-for-All-Time-but-only-graph-a-specified-time-range/m-p/309907#M92998</guid>
      <dc:creator>kyule</dc:creator>
      <dc:date>2020-09-29T16:21:53Z</dc:date>
    </item>
  </channel>
</rss>

