<?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 create line chart using Time (Hour) in Y-axis and Date (Days) in X-axis in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-create-line-chart-using-Time-Hour-in-Y-axis-and-Date-Days-in/m-p/293470#M88597</link>
    <description>&lt;P&gt;Interesting use case.  &lt;/P&gt;

&lt;P&gt;Okay, so you have dates across the bottom, and you have jobs that always run in sequence, and you need to know when they ran, so you're making the equivalent of a stacked bar chart and visually conforming it to a line chart...&lt;/P&gt;

&lt;P&gt;Okay, you can GET the graph, that's not a problem. Strip your problem back to understanding what will put the points on the graph...&lt;/P&gt;

&lt;P&gt;Your target events basically have this format... &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;_time   (the display date), 
RunTime (the number of seconds after midnight they ran)
JobStep (the title for that series)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;...but really, your production window looks like 10PM to 11AM, so that format needs to be modified to... &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;_time   (the display date... the date of the prior night)
RunTime (the number of seconds after window-start that they ran)
JobStep (the title for that series)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;When you put it into that format, you can get your desired line graphs.  The main problem is the lack of being able to format the y axis, especially when you're rolling over from p to a.&lt;/P&gt;

&lt;P&gt;My temptation on this one would be to bump the date up to the next day and calculate the decimal hours, so that the left axis starts at -2 for 10pm and goes up to +12 for noon. &lt;/P&gt;</description>
    <pubDate>Thu, 17 Aug 2017 22:20:12 GMT</pubDate>
    <dc:creator>DalJeanis</dc:creator>
    <dc:date>2017-08-17T22:20:12Z</dc:date>
    <item>
      <title>How create line chart using Time (Hour) in Y-axis and Date (Days) in X-axis</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-create-line-chart-using-Time-Hour-in-Y-axis-and-Date-Days-in/m-p/293468#M88595</link>
      <description>&lt;P&gt;Hi Guys,&lt;/P&gt;

&lt;P&gt;Well, I have this structured log:&lt;BR /&gt;
 MEMBER, JOBNAME, JOBID, DATE_START, HOUR_START, DATE_END, HOUR_END, DURATION, GROUP, CPUTIME&lt;BR /&gt;
    PLCZBA20,PLCZBA20,21010,07/26/17,17:00,07/26/17,17:00,00:11,UAT,00:00.3&lt;BR /&gt;
    PLCADA20,PLCADA20,21008,07/26/17,17:00,07/26/17,17:00,00:11,UAT,00:00.4&lt;/P&gt;

&lt;P&gt;And I'm trying to create next chart (for example):&lt;/P&gt;

&lt;P&gt;&lt;IMG src="https://community.splunk.com/storage/temp/210605-image.png" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;I comment on them, the field &lt;STRONG&gt;DURATION&lt;/STRONG&gt; is in the following format &lt;EM&gt;%M:%S&lt;/EM&gt;  and fields &lt;STRONG&gt;HOUR_START&lt;/STRONG&gt; &amp;amp; &lt;STRONG&gt;HOUR_END&lt;/STRONG&gt; in &lt;EM&gt;%H:M%&lt;/EM&gt;,&lt;BR /&gt;
now the field _time take correctly start date and time.&lt;/P&gt;

&lt;P&gt;I was trying with this query, but it didn't convert to display time in the Y-axis and I'm not sure if this is the right way.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;MYSEARCH
| bucket _time span=1d
| rex field=DURATION "(?&amp;lt;Mins&amp;gt;.{2}+):(?&amp;lt;Sec&amp;gt;.{2}+)" 
| fillnull value=0
| eval secs=Mins*60+Sec
| eval duration = secs * 1000 
| stats count by _time, duration, "JOBNAME"
| table _time "JOBNAME"  duration
| convert timeformat="%H:%M" ctime(duration) AS duration
| chart max(duration) over _time by JOBNAME
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Can someone help me please!!&lt;/P&gt;

&lt;P&gt;regards..&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 15:26:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-create-line-chart-using-Time-Hour-in-Y-axis-and-Date-Days-in/m-p/293468#M88595</guid>
      <dc:creator>julio19</dc:creator>
      <dc:date>2020-09-29T15:26:59Z</dc:date>
    </item>
    <item>
      <title>Re: How create line chart using Time (Hour) in Y-axis and Date (Days) in X-axis</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-create-line-chart-using-Time-Hour-in-Y-axis-and-Date-Days-in/m-p/293469#M88596</link>
      <description>&lt;P&gt;I'm a little fuzzy on what you're trying to do, however you may what to use the &lt;CODE&gt;|timechart&lt;/CODE&gt; command&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| timechart span=1h&lt;/CODE&gt; will give you hourly buckets of things&lt;/P&gt;

&lt;P&gt;so maybe&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; &amp;lt;my_root_search&amp;gt; 
 | rex field=DURATION "(?&amp;lt;Mins&amp;gt;.{2}+):(?&amp;lt;Sec&amp;gt;.{2}+)" 
 | fillnull value=0
 | eval secs=Mins*60+Sec
 | eval duration = secs * 1000 
 | timechart span=1h max(duration) AS duration by JOBNAME
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 Aug 2017 22:01:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-create-line-chart-using-Time-Hour-in-Y-axis-and-Date-Days-in/m-p/293469#M88596</guid>
      <dc:creator>tmarlette</dc:creator>
      <dc:date>2017-08-17T22:01:13Z</dc:date>
    </item>
    <item>
      <title>Re: How create line chart using Time (Hour) in Y-axis and Date (Days) in X-axis</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-create-line-chart-using-Time-Hour-in-Y-axis-and-Date-Days-in/m-p/293470#M88597</link>
      <description>&lt;P&gt;Interesting use case.  &lt;/P&gt;

&lt;P&gt;Okay, so you have dates across the bottom, and you have jobs that always run in sequence, and you need to know when they ran, so you're making the equivalent of a stacked bar chart and visually conforming it to a line chart...&lt;/P&gt;

&lt;P&gt;Okay, you can GET the graph, that's not a problem. Strip your problem back to understanding what will put the points on the graph...&lt;/P&gt;

&lt;P&gt;Your target events basically have this format... &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;_time   (the display date), 
RunTime (the number of seconds after midnight they ran)
JobStep (the title for that series)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;...but really, your production window looks like 10PM to 11AM, so that format needs to be modified to... &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;_time   (the display date... the date of the prior night)
RunTime (the number of seconds after window-start that they ran)
JobStep (the title for that series)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;When you put it into that format, you can get your desired line graphs.  The main problem is the lack of being able to format the y axis, especially when you're rolling over from p to a.&lt;/P&gt;

&lt;P&gt;My temptation on this one would be to bump the date up to the next day and calculate the decimal hours, so that the left axis starts at -2 for 10pm and goes up to +12 for noon. &lt;/P&gt;</description>
      <pubDate>Thu, 17 Aug 2017 22:20:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-create-line-chart-using-Time-Hour-in-Y-axis-and-Date-Days-in/m-p/293470#M88597</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-08-17T22:20:12Z</dc:date>
    </item>
    <item>
      <title>Re: How create line chart using Time (Hour) in Y-axis and Date (Days) in X-axis</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-create-line-chart-using-Time-Hour-in-Y-axis-and-Date-Days-in/m-p/293471#M88598</link>
      <description>&lt;P&gt;First thanks for yout time,  is correctly query but, i can show time in Y-axis in one format similar to the image %H:%M:%S&lt;BR /&gt;&lt;BR /&gt;
This is possible? or exist any app that can help me?&lt;/P&gt;</description>
      <pubDate>Thu, 17 Aug 2017 22:20:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-create-line-chart-using-Time-Hour-in-Y-axis-and-Date-Days-in/m-p/293471#M88598</guid>
      <dc:creator>julio19</dc:creator>
      <dc:date>2017-08-17T22:20:59Z</dc:date>
    </item>
    <item>
      <title>Re: How create line chart using Time (Hour) in Y-axis and Date (Days) in X-axis</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-create-line-chart-using-Time-Hour-in-Y-axis-and-Date-Days-in/m-p/293472#M88599</link>
      <description>&lt;P&gt;Hi @julio19,&lt;/P&gt;

&lt;P&gt;can you paste the complete code of your query graph?&lt;BR /&gt;
I have the same problem.&lt;/P&gt;

&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Wed, 15 May 2019 11:01:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-create-line-chart-using-Time-Hour-in-Y-axis-and-Date-Days-in/m-p/293472#M88599</guid>
      <dc:creator>kingwaras</dc:creator>
      <dc:date>2019-05-15T11:01:48Z</dc:date>
    </item>
  </channel>
</rss>

