<?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 do I create a line chart using epoch values, but convert the y and x-axis labels to a human readable format? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-create-a-line-chart-using-epoch-values-but-convert-the/m-p/251144#M75018</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;

&lt;P&gt;I need to chart a series of time(epoch) values over time. So basically, I want to show Dates on both the X and Y Axis of a linechart. After converting the Y-values to epoch, I get a nice line. However epoch values are not very user-friendly, so I would like to convert the axis labels back into a readable format. I created a screenshot to illustrate the problem:&lt;BR /&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/848i7DDE358038A0BE05/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;I tried using "fieldformat" and "convert timeformat...", neither works. If inserted  before the chart command, the line can not be drawn anymore, if inserted after, the labels do not change. Using a timechart helps with the X-Axis, but doesn't change anything about the Y-Axis. &lt;/P&gt;</description>
    <pubDate>Wed, 25 Nov 2015 19:46:28 GMT</pubDate>
    <dc:creator>Dohrendorf_Cons</dc:creator>
    <dc:date>2015-11-25T19:46:28Z</dc:date>
    <item>
      <title>How do I create a line chart using epoch values, but convert the y and x-axis labels to a human readable format?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-create-a-line-chart-using-epoch-values-but-convert-the/m-p/251144#M75018</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;

&lt;P&gt;I need to chart a series of time(epoch) values over time. So basically, I want to show Dates on both the X and Y Axis of a linechart. After converting the Y-values to epoch, I get a nice line. However epoch values are not very user-friendly, so I would like to convert the axis labels back into a readable format. I created a screenshot to illustrate the problem:&lt;BR /&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/848i7DDE358038A0BE05/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;I tried using "fieldformat" and "convert timeformat...", neither works. If inserted  before the chart command, the line can not be drawn anymore, if inserted after, the labels do not change. Using a timechart helps with the X-Axis, but doesn't change anything about the Y-Axis. &lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2015 19:46:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-create-a-line-chart-using-epoch-values-but-convert-the/m-p/251144#M75018</guid>
      <dc:creator>Dohrendorf_Cons</dc:creator>
      <dc:date>2015-11-25T19:46:28Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a line chart using epoch values, but convert the y and x-axis labels to a human readable format?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-create-a-line-chart-using-epoch-values-but-convert-the/m-p/251145#M75019</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/140141"&gt;@Dohrendorf_Cons&lt;/a&gt;ist,&lt;BR /&gt;
Have you tried using the "strftime" command in your query to convert the way the time stamp is rendered? Here is some documentation that might help:&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.3.1/SearchReference/CommonEvalFunctions#Date_and_Time_functions" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/6.3.1/SearchReference/CommonEvalFunctions#Date_and_Time_functions&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;See also this older Answers post, which seems related to your question:&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/11649/specify-timestamp-display-format-for-timechart-axis-labels.html" target="_blank"&gt;https://answers.splunk.com/answers/11649/specify-timestamp-display-format-for-timechart-axis-labels.html&lt;/A&gt;&lt;BR /&gt;
Hope this helps! Let me know if not and we can keep discussing.&lt;/P&gt;

&lt;P&gt;All best,&lt;BR /&gt;
@frobinson_splunk&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 07:58:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-create-a-line-chart-using-epoch-values-but-convert-the/m-p/251145#M75019</guid>
      <dc:creator>frobinson_splun</dc:creator>
      <dc:date>2020-09-29T07:58:20Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a line chart using epoch values, but convert the y and x-axis labels to a human readable format?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-create-a-line-chart-using-epoch-values-but-convert-the/m-p/251146#M75020</link>
      <description>&lt;P&gt;I already had tried that, but it only works on the X-Axis. Using strftime on the Y-Axis results in the line no longer being drawn, apparently because the values are strings after formatting them, which makes sense.&lt;/P&gt;

&lt;P&gt;Any other suggestions?&lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2015 09:12:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-create-a-line-chart-using-epoch-values-but-convert-the/m-p/251146#M75020</guid>
      <dc:creator>Dohrendorf_Cons</dc:creator>
      <dc:date>2015-11-26T09:12:35Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a line chart using epoch values, but convert the y and x-axis labels to a human readable format?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-create-a-line-chart-using-epoch-values-but-convert-the/m-p/251147#M75021</link>
      <description>&lt;P&gt;Dohrendorf,&lt;BR /&gt;
Did you make it ?&lt;BR /&gt;
I'm trying here and I'm having the same problem&lt;/P&gt;

&lt;P&gt;tks&lt;/P&gt;</description>
      <pubDate>Fri, 14 Sep 2018 14:04:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-create-a-line-chart-using-epoch-values-but-convert-the/m-p/251147#M75021</guid>
      <dc:creator>rafaelvjb</dc:creator>
      <dc:date>2018-09-14T14:04:02Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a line chart using epoch values, but convert the y and x-axis labels to a human readable format?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-create-a-line-chart-using-epoch-values-but-convert-the/m-p/251148#M75022</link>
      <description>&lt;P&gt;Hi, I've done some tricks to do this ...&lt;/P&gt;

&lt;P&gt;in the query I converted hh: mm: ss to a number (because string does not write points in the graph):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...
    | chart max(epoch_time) as max_time by date
    | eval max_time = tonumber(strftime(max_time, "%H%M%S"))
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;into html dashboard, after render() my chartElement (or chartView) &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; element4.on("rendered", function () {
            $($("#element4 tspan")).each(function () {
                console.log("element4 : " + $(this).text());
                var rex = new RegExp("[0-9]{0,3},[0-9]{3}");
                if (rex.test($(this).text())) {
                    var hhnum = $(this).text().replace(",", "");
                    var hhzeros = String("000000" + horanumeral).slice(-6);
                    var hhfinal = (horacomzeros).substr(0, 2) + ":" + (horacomzeros).substr(2, 2)
                    $(this).text(hhfinal);
                } else if ($(this).text() &amp;lt; 1000) {
                    var hhzeros = String("000000" + horanumeral).slice(-6);
                    var hhfinal = (horacomzeros).substr(0, 2) + ":" + (horacomzeros).substr(2, 2)
                    $(this).text(hhfinal);
                };
            });
        });
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This code needs some refactoring, but this was my first successful case&lt;/P&gt;</description>
      <pubDate>Tue, 25 Sep 2018 20:01:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-create-a-line-chart-using-epoch-values-but-convert-the/m-p/251148#M75022</guid>
      <dc:creator>rafaelvjb</dc:creator>
      <dc:date>2018-09-25T20:01:29Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a line chart using epoch values, but convert the y and x-axis labels to a human readable format?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-create-a-line-chart-using-epoch-values-but-convert-the/m-p/251149#M75023</link>
      <description>&lt;P&gt;oh, and the x axis, just add some eval to replace after charting...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| chart max(time) as max_time by datex 
| eval datex = strftime(datex, "%d/%m")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 25 Sep 2018 20:04:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-create-a-line-chart-using-epoch-values-but-convert-the/m-p/251149#M75023</guid>
      <dc:creator>rafaelvjb</dc:creator>
      <dc:date>2018-09-25T20:04:18Z</dc:date>
    </item>
  </channel>
</rss>

