<?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 can I create a chart with the range start and end date in the y-axis? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-create-a-chart-with-the-range-start-and-end-date-in/m-p/309292#M92769</link>
    <description>&lt;P&gt;If you need that, here's one easy way:&lt;/P&gt;

&lt;P&gt;1) Convert the start time to decimal hours after midnight.&lt;BR /&gt;
2) Calculate the duration of the job in decimal hours.&lt;BR /&gt;
3) Present the results as a stacked bar chart with the start time on the bottom and the duration on top.&lt;/P&gt;</description>
    <pubDate>Thu, 30 Nov 2017 22:14:55 GMT</pubDate>
    <dc:creator>DalJeanis</dc:creator>
    <dc:date>2017-11-30T22:14:55Z</dc:date>
    <item>
      <title>How can I create a chart with the range start and end date in the y-axis?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-create-a-chart-with-the-range-start-and-end-date-in/m-p/309291#M92768</link>
      <description>&lt;P&gt;Example data :&lt;/P&gt;

&lt;P&gt;start_date                            end_date                                     batch_name&lt;BR /&gt;
2017-11-18 12:12:13          2017-11-18 15:12:13                 job1&lt;BR /&gt;
2017-11-18 10:12:13          2017-11-18 12:12:13                 job2&lt;/P&gt;

&lt;P&gt;I have to create a chart where the x-axis contains the timechart span=1d  by batch_nm and y axis should display the range start_date and end_date data so that we can see when the job1 started and job1 ended.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:59:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-create-a-chart-with-the-range-start-and-end-date-in/m-p/309291#M92768</guid>
      <dc:creator>venkatsivab</dc:creator>
      <dc:date>2020-09-29T16:59:35Z</dc:date>
    </item>
    <item>
      <title>Re: How can I create a chart with the range start and end date in the y-axis?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-create-a-chart-with-the-range-start-and-end-date-in/m-p/309292#M92769</link>
      <description>&lt;P&gt;If you need that, here's one easy way:&lt;/P&gt;

&lt;P&gt;1) Convert the start time to decimal hours after midnight.&lt;BR /&gt;
2) Calculate the duration of the job in decimal hours.&lt;BR /&gt;
3) Present the results as a stacked bar chart with the start time on the bottom and the duration on top.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Nov 2017 22:14:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-create-a-chart-with-the-range-start-and-end-date-in/m-p/309292#M92769</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-11-30T22:14:55Z</dc:date>
    </item>
    <item>
      <title>Re: How can I create a chart with the range start and end date in the y-axis?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-create-a-chart-with-the-range-start-and-end-date-in/m-p/309293#M92770</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval raw="2017-11-18 12:12:13 2017-11-18 15:12:13 job1::2017-11-18 10:12:13 2017-11-18 12:12:13 job2"
| makemv delim="::" raw
| mvexpand raw
| rename raw AS _raw
| rex "^(?&amp;lt;start_date&amp;gt;\S+\s+\S+)\s+(?&amp;lt;end_date&amp;gt;\S+\s+\S+)\s+(?&amp;lt;job_id&amp;gt;\S+)$"
| fields - _raw

| rename COMMENT AS "Everything above generates sample event data; everything below is your solution"

| eval start_date = strptime(start_date, "%Y-%m-%d %H:%M:%S")
| eval end_date = strptime(end_date, "%Y-%m-%d %H:%M:%S")
| eval _time = start_date
| fieldformat start_date=strftime(start_date, "%Y-%m-%d %H:%M:%S")
| fieldformat end_date=strftime(end_date, "%Y-%m-%d %H:%M:%S")
| eval duration = end_date - start_date
| rename COMMENT AS "to convert to minutes, add '| eval duration=duration/60'"
| rename COMMENT AS "to convert to hours, add '| eval duration=duration/(60*60)'"
| timechart avg(duration) AS duration BY job_id
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 01 Dec 2017 15:27:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-create-a-chart-with-the-range-start-and-end-date-in/m-p/309293#M92770</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-12-01T15:27:09Z</dc:date>
    </item>
    <item>
      <title>Re: How can I create a chart with the range start and end date in the y-axis?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-create-a-chart-with-the-range-start-and-end-date-in/m-p/605429#M210541</link>
      <description>&lt;P&gt;How can we&amp;nbsp;&lt;SPAN&gt;Present the results as a stacked bar chart with the start time on the bottom and the duration on top.&lt;/SPAN&gt;&lt;BR /&gt;can you please help ?&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jul 2022 11:07:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-create-a-chart-with-the-range-start-and-end-date-in/m-p/605429#M210541</guid>
      <dc:creator>shugup2923</dc:creator>
      <dc:date>2022-07-13T11:07:00Z</dc:date>
    </item>
  </channel>
</rss>

