<?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: Chart displaying UNIX timestamp on x axis. How to change to human readable date? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Chart-displaying-UNIX-timestamp-on-x-axis-How-to-change-to-human/m-p/42741#M10017</link>
    <description>&lt;P&gt;This seems like it would display readable dates along the x-axis:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="p5_reports" | dedup PredictionTime regionID | chart max(Price) over PredictionTime by regionID
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 11 Feb 2011 14:44:31 GMT</pubDate>
    <dc:creator>Ron_Naken</dc:creator>
    <dc:date>2011-02-11T14:44:31Z</dc:date>
    <item>
      <title>Chart displaying UNIX timestamp on x axis. How to change to human readable date?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Chart-displaying-UNIX-timestamp-on-x-axis-How-to-change-to-human/m-p/42740#M10016</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;

&lt;P&gt;I'll start with the data we are dealing with. It deals with predictions of a price into the future. We receive data every five minutes with a prediction of a future price.&lt;/P&gt;

&lt;P&gt;&lt;B&gt;First set of data&lt;/B&gt;&lt;BR /&gt;
DateTimeOfPrediction, PredictionTime, Price, regionID&lt;BR /&gt;
2011/02/11 15:05:00, 2011/02/11 15:10:00, 30, VIC&lt;BR /&gt;
2011/02/11 15:05:00, 2011/02/11 15:15:00, 33, VIC&lt;BR /&gt;
2011/02/11 15:05:00, 2011/02/11 15:20:00, 32, VIC&lt;BR /&gt;
2011/02/11 15:05:00, 2011/02/11 15:25:00, 34, VIC&lt;BR /&gt;
2011/02/11 15:05:00, 2011/02/11 15:30:00, 36, VIC&lt;BR /&gt;
2011/02/11 15:05:00, 2011/02/11 15:35:00, 33, VIC&lt;BR /&gt;&lt;/P&gt;

&lt;P&gt;&lt;B&gt;Then the next set of data arrives 5 minutes later&lt;/B&gt;&lt;BR /&gt;
DateTimeOfPrediction, PredictionTime, Price, regionID&lt;BR /&gt;
2011/02/11 15:10:00, 2011/02/11 15:10:00, 30, VIC&lt;BR /&gt;
2011/02/11 15:10:00, 2011/02/11 15:15:00, 37, VIC&lt;BR /&gt;
2011/02/11 15:10:00, 2011/02/11 15:20:00, 33, VIC&lt;BR /&gt;
2011/02/11 15:10:00, 2011/02/11 15:25:00, 34, VIC&lt;BR /&gt;
2011/02/11 15:10:00, 2011/02/11 15:30:00, 32, VIC&lt;BR /&gt;&lt;/P&gt;

&lt;P&gt;As you can see we end up getting multiple copies of PredictionTime for each time the prediction is made. Now I want to chart the most recent prediction for each time. Meaning x-axis being the PredictionTime and y-axis being the Price.&lt;/P&gt;

&lt;P&gt;So we started with this which works and gets the most recent versions of each PredictionTime&lt;BR /&gt;
sourcetype="p5_reports" | dedup PredictionTime, regionID&lt;/P&gt;

&lt;P&gt;Next we tried to set the _time to the PredictionTime as by default splunk made _time = DateTimeOfPrediction&lt;BR /&gt;
sourcetype="p5_reports" | dedup PredictionTime, regionID | eval _time=strptime(PredictionTime,"%Y/%m/%d %H:%M:%S")&lt;/P&gt;

&lt;P&gt;This fails everytime and gives the error&lt;BR /&gt;
&lt;I&gt;      [EventsViewer module] Cannot access search data; job 1297402597.221 is a zombie and is no longer with us&lt;/I&gt;&lt;/P&gt;

&lt;P&gt;So we played around some more and can get charting however the x axis labels are &lt;STRONG&gt;only displaying unix timestamps&lt;/STRONG&gt; not a human readable date.&lt;BR /&gt;
&lt;B&gt;semi working version&lt;/B&gt;&lt;BR /&gt;
 sourcetype="p5_reports" | dedup PredictionTime , regionID| eval IDT=strptime(PredictionTime,"%Y/%m/%d %H:%M:%S") | chart max(Price) by IDT span=5m, regionID&lt;/P&gt;

&lt;P&gt;Anyone got an idea how to resolve this and get the x-axis to display a human readable date?&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 11 Feb 2011 13:41:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Chart-displaying-UNIX-timestamp-on-x-axis-How-to-change-to-human/m-p/42740#M10016</guid>
      <dc:creator>phoenixdigital</dc:creator>
      <dc:date>2011-02-11T13:41:55Z</dc:date>
    </item>
    <item>
      <title>Re: Chart displaying UNIX timestamp on x axis. How to change to human readable date?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Chart-displaying-UNIX-timestamp-on-x-axis-How-to-change-to-human/m-p/42741#M10017</link>
      <description>&lt;P&gt;This seems like it would display readable dates along the x-axis:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="p5_reports" | dedup PredictionTime regionID | chart max(Price) over PredictionTime by regionID
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 11 Feb 2011 14:44:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Chart-displaying-UNIX-timestamp-on-x-axis-How-to-change-to-human/m-p/42741#M10017</guid>
      <dc:creator>Ron_Naken</dc:creator>
      <dc:date>2011-02-11T14:44:31Z</dc:date>
    </item>
    <item>
      <title>Re: Chart displaying UNIX timestamp on x axis. How to change to human readable date?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Chart-displaying-UNIX-timestamp-on-x-axis-How-to-change-to-human/m-p/42742#M10018</link>
      <description>&lt;P&gt;Thanks heaps that worked alot better than my attempts.&lt;/P&gt;

&lt;P&gt;Still a small problem which is probably resolved easily but not with my tests.&lt;/P&gt;

&lt;P&gt;As you can see from this screenshot the chart doesn't really show the hours and minutes as it is trying to render the whole date and time.&lt;A href="http://i56.tinypic.com/k142td.gif"&gt;http://i56.tinypic.com/k142td.gif&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;I tried this but got no results unfortunately&lt;/P&gt;

&lt;P&gt;sourcetype="p5_reports" | dedup PredictionTime, RegionID | eval IDT=strftime(PredictionTime, "%H:%M") | chart max(RRP) over IDT by RegionID&lt;/P&gt;

&lt;P&gt;This has no results unfortunately&lt;/P&gt;</description>
      <pubDate>Mon, 14 Feb 2011 12:09:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Chart-displaying-UNIX-timestamp-on-x-axis-How-to-change-to-human/m-p/42742#M10018</guid>
      <dc:creator>phoenixdigital</dc:creator>
      <dc:date>2011-02-14T12:09:22Z</dc:date>
    </item>
    <item>
      <title>Re: Chart displaying UNIX timestamp on x axis. How to change to human readable date?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Chart-displaying-UNIX-timestamp-on-x-axis-How-to-change-to-human/m-p/42743#M10019</link>
      <description>&lt;P&gt;apologies for the formatting seems this wont accept html&lt;/P&gt;</description>
      <pubDate>Mon, 14 Feb 2011 12:09:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Chart-displaying-UNIX-timestamp-on-x-axis-How-to-change-to-human/m-p/42743#M10019</guid>
      <dc:creator>phoenixdigital</dc:creator>
      <dc:date>2011-02-14T12:09:40Z</dc:date>
    </item>
    <item>
      <title>Re: Chart displaying UNIX timestamp on x axis. How to change to human readable date?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Chart-displaying-UNIX-timestamp-on-x-axis-How-to-change-to-human/m-p/42744#M10020</link>
      <description>&lt;P&gt;You need to use strptime() to convert a string into EPOCH -- it looks like you used strftime() -- | eval IDT=strptime(PredictionTime, "%Y/%m/%d %H:%M:%S").  Make sure you get the time format string correct.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Feb 2011 08:00:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Chart-displaying-UNIX-timestamp-on-x-axis-How-to-change-to-human/m-p/42744#M10020</guid>
      <dc:creator>Ron_Naken</dc:creator>
      <dc:date>2011-02-15T08:00:00Z</dc:date>
    </item>
    <item>
      <title>Re: Chart displaying UNIX timestamp on x axis. How to change to human readable date?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Chart-displaying-UNIX-timestamp-on-x-axis-How-to-change-to-human/m-p/42745#M10021</link>
      <description>&lt;P&gt;It should work if you convert IDT to EPOCH (strptime), chart by IDT as EPOCH, then eval IDT back to a time/date format after the chart command (strftime).&lt;/P&gt;</description>
      <pubDate>Tue, 15 Feb 2011 08:03:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Chart-displaying-UNIX-timestamp-on-x-axis-How-to-change-to-human/m-p/42745#M10021</guid>
      <dc:creator>Ron_Naken</dc:creator>
      <dc:date>2011-02-15T08:03:01Z</dc:date>
    </item>
  </channel>
</rss>

