<?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: How to add x-axis labels show on a timechart when data contains epoch time? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-x-axis-labels-show-on-a-timechart-when-data-contains/m-p/302163#M90937</link>
    <description>&lt;P&gt;You are massively overcomplicating the situation.  Try this (just TRY it, without modifying it):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=_* OR index=* source="live logs.zip:.\\tenant_1.tgz:.\\tenant_1/application_24978294676695149906/application.log" sourcetype="tenant_1/application_00247908011074894418/application"
| timechart span=1h avg(temperature_value)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If this doesn't look right, then add this line &lt;EM&gt;BEFORE&lt;/EM&gt; the &lt;CODE&gt;timechart&lt;/CODE&gt; line:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval _time=timeStamp_Temperature
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Also, you might prefer &lt;CODE&gt;min&lt;/CODE&gt; or &lt;CODE&gt;max&lt;/CODE&gt; to &lt;CODE&gt;avg&lt;/CODE&gt; (which is what the error was trying to tell you: you have to have a stats function applied to your field name).&lt;/P&gt;</description>
    <pubDate>Wed, 12 Jul 2017 14:49:23 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2017-07-12T14:49:23Z</dc:date>
    <item>
      <title>How to add x-axis labels show on a timechart when data contains epoch time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-x-axis-labels-show-on-a-timechart-when-data-contains/m-p/302160#M90934</link>
      <description>&lt;P&gt;Hi, I am still fairly new in Splunk as I just started last week. Any help is appreciated!!&lt;/P&gt;

&lt;P&gt;This is what i currently have now in my search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_* OR index=* source="live logs.zip:.\\tenant_1.tgz:.\\tenant_1/application_24978294676695149906/application.log" sourcetype="tenant_1/application_00247908011074894418/application" | eval TIME=strftime(timeStamp_Temperature, "%d-%m-%Y %H:%M:%S")  | search TIME!="31-12-9999 23:59:59" | timechart span=1h last(TIME) as TIME by temperature_value    | eval  threshold = 30 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/3185iED6BF82EC5CF1D9C/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;BR /&gt;
The search produced this (Above)  but this isn't what I want.&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/3186i5AD5FF78EC9692A3/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;BR /&gt;
This is what I want but I require the graph to show the axis time labels (P.s this search is based from using Table but I read in the documentation that it requires timechart to work)&lt;/P&gt;

&lt;P&gt;May I know what I did wrong here? &lt;/P&gt;

&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2017 14:45:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-x-axis-labels-show-on-a-timechart-when-data-contains/m-p/302160#M90934</guid>
      <dc:creator>Michellework</dc:creator>
      <dc:date>2017-07-10T14:45:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to add x-axis labels show on a timechart when data contains epoch time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-x-axis-labels-show-on-a-timechart-when-data-contains/m-p/302161#M90935</link>
      <description>&lt;P&gt;1) Okay, you didn't tell us what you want the graph to tell you, and your code is confusing, so we're a bit in the dark. &lt;/P&gt;

&lt;P&gt;2) When using &lt;CODE&gt;timechart&lt;/CODE&gt;, the x axis is always based on the value of the field  _time. Whatever aggregate function you use determines the Y value, and the &lt;CODE&gt;BY field&lt;/CODE&gt; breaks the graph up into multiple series.&lt;/P&gt;

&lt;P&gt;3) Do you really want just the last time that each particular &lt;CODE&gt;temperature_value&lt;/CODE&gt; occurred?  That could be as simple as this...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Your search
| dedup temperature_value
| eval _time=timeStamp_Temperature
| timechart span=1h count by temperature_value
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;4) On the other hand, if you want to know how many times a particular temperature was hit in each hour, that would be even simpler, like this...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Your search
| eval _time=timeStamp_Temperature
| timechart span=1h count by temperature_value
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;5) and if you wanted the temperatures grouped into &lt;CODE&gt;buckets&lt;/CODE&gt; or &lt;CODE&gt;bins&lt;/CODE&gt;, for example 5 degree ranges, then you could do this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Your search
| eval _time=timeStamp_Temperature
| bin temperature_value span=5
| timechart span=1h count by temperature_value
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If none of those are what you are looking for, then please describe what you want the graph to show, and we'll get you sorted out.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jul 2017 04:38:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-x-axis-labels-show-on-a-timechart-when-data-contains/m-p/302161#M90935</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-07-11T04:38:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to add x-axis labels show on a timechart when data contains epoch time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-x-axis-labels-show-on-a-timechart-when-data-contains/m-p/302162#M90936</link>
      <description>&lt;P&gt;Hi DalJeanis, &lt;/P&gt;

&lt;P&gt;First of all, thank you for replying to my question!&lt;/P&gt;

&lt;P&gt;After looking at points 1 and 2, I realized what I actually needed. I require the graph to just show the temperatures (y axis) vs time (x axis).  my index contains a series of temperatures recorded at every 3sec time interval (this is what I want to show)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_* OR index=* source="live logs.zip:.\\tenant_1.tgz:.\\tenant_1/application_24978294676695149906/application.log" sourcetype="tenant_1/application_00247908011074894418/application" | eval TIME=strftime(timeStamp_Temperature, "%d-%m-%Y %H:%M:%S")  |
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;TIME will convert my epoch time to time in  "%d-%m-%Y %H:%M:%S" which is the label i need (with reference to ss-wrong.png - first picture's x axis)&lt;/P&gt;

&lt;P&gt;Hence, I am not sure how to write the timechart query such that i can get temp vs time graph. &lt;BR /&gt;
I tried &lt;CODE&gt;timechart span=1h temperature_value by _time&lt;/CODE&gt; but it throws an error that I need to add an aggregate function before temperature_value field. Is there any way to not alter the temperature values from the indexed dataset but at the same time use timechart to show time labels on the x-axis?&lt;/P&gt;

&lt;P&gt;Thank you!!!&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jul 2017 05:55:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-x-axis-labels-show-on-a-timechart-when-data-contains/m-p/302162#M90936</guid>
      <dc:creator>Michellework</dc:creator>
      <dc:date>2017-07-11T05:55:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to add x-axis labels show on a timechart when data contains epoch time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-x-axis-labels-show-on-a-timechart-when-data-contains/m-p/302163#M90937</link>
      <description>&lt;P&gt;You are massively overcomplicating the situation.  Try this (just TRY it, without modifying it):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=_* OR index=* source="live logs.zip:.\\tenant_1.tgz:.\\tenant_1/application_24978294676695149906/application.log" sourcetype="tenant_1/application_00247908011074894418/application"
| timechart span=1h avg(temperature_value)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If this doesn't look right, then add this line &lt;EM&gt;BEFORE&lt;/EM&gt; the &lt;CODE&gt;timechart&lt;/CODE&gt; line:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval _time=timeStamp_Temperature
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Also, you might prefer &lt;CODE&gt;min&lt;/CODE&gt; or &lt;CODE&gt;max&lt;/CODE&gt; to &lt;CODE&gt;avg&lt;/CODE&gt; (which is what the error was trying to tell you: you have to have a stats function applied to your field name).&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jul 2017 14:49:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-x-axis-labels-show-on-a-timechart-when-data-contains/m-p/302163#M90937</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-07-12T14:49:23Z</dc:date>
    </item>
  </channel>
</rss>

