<?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 and Date in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-create-line-chart-using-Time-and-Date/m-p/455509#M128796</link>
    <description>&lt;P&gt;As far as I am aware, you can't make the Y axis in Splunk be non-numeric.  It will split the values into different lines for each timestamp you have there instead of a single line.  &lt;/P&gt;

&lt;P&gt;Documentation: &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.2.5/Viz/LineAreaCharts#Data_formatting"&gt;https://docs.splunk.com/Documentation/Splunk/7.2.5/Viz/LineAreaCharts#Data_formatting&lt;/A&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults count=1 
| eval data="Job_Name,10/12/2018 07:14,10/12/2018,07:14
Job_Name,12/12/2018 07:14,12/12/2018,07:14
Job_Name,13/12/2018 09:04,13/12/2018,09:04
Job_Name,14/12/2018 11:11,14/12/2018,11:11" 
| fields - _time 
| rex field=data max_match=0 "(?&amp;lt;data&amp;gt;[^\n\e]+)" 
| eval data=trim(data) 
| mvexpand data
| rex field=data "(?&amp;lt;SERVICE&amp;gt;[^\,]+),(?&amp;lt;END_TIME&amp;gt;[^\,]+),(?&amp;lt;DATA&amp;gt;[^\,]+),(?&amp;lt;TIME&amp;gt;[^\e]+)"
| eval DATA=strftime(strptime(DATA, "%d/%m/%Y"), "%d-%b-%y")
| eval TIME=strftime(strptime(TIME, "%H:%M"), "%H:%M:%S")
| eval count=1
| xyseries DATA TIME count
&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/7048iD4C711F57766DFB5/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;A timechart would probably be more beneficial, but it won't have that timestamped Y axis and you would need to hover over the visualization to see the minute:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults count=1 
| eval data="Job_Name,10/12/2018 07:14,10/12/2018,07:14
Job_Name,12/12/2018 07:14,12/12/2018,07:14
Job_Name,13/12/2018 09:04,13/12/2018,09:04
Job_Name,14/12/2018 11:11,14/12/2018,11:11" 
| fields - _time 
| rex field=data max_match=0 "(?&amp;lt;data&amp;gt;[^\n\e]+)" 
| eval data=trim(data) 
| mvexpand data
| rex field=data "(?&amp;lt;SERVICE&amp;gt;[^\,]+),(?&amp;lt;END_TIME&amp;gt;[^\,]+),(?&amp;lt;DATA&amp;gt;[^\,]+),(?&amp;lt;TIME&amp;gt;[^\e]+)"
| eval _time=strptime(DATA.TIME, "%d/%m/%Y%H:%M")
| timechart span=1m count
| search count&amp;gt;0
&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/7049i584E84B397B5D369/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 15 May 2019 15:32:37 GMT</pubDate>
    <dc:creator>dmarling</dc:creator>
    <dc:date>2019-05-15T15:32:37Z</dc:date>
    <item>
      <title>How create line chart using Time and Date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-create-line-chart-using-Time-and-Date/m-p/455508#M128795</link>
      <description>&lt;P&gt;Hi Guys,&lt;/P&gt;

&lt;P&gt;I need your help.&lt;BR /&gt;
I have this structured log:&lt;/P&gt;

&lt;P&gt;SERVICE,END_TIME,DATA,TIME&lt;BR /&gt;
Job_Name,10/12/2018 07:14,10/12/2018,07:14&lt;BR /&gt;
Job_Name,12/12/2018 07:14,12/12/2018,07:14&lt;BR /&gt;
Job_Name,13/12/2018 09:04,13/12/2018,09:04&lt;BR /&gt;
Job_Name,14/12/2018 11:11,14/12/2018,11:11&lt;/P&gt;

&lt;P&gt;I need to create this graph where there is Time (Hour) in Y-axis and Date (Days) in X-axis:&lt;/P&gt;

&lt;P&gt;&lt;IMG src="https://community.splunk.com/storage/temp/272721-2019-05-15-131756.png" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;Which is the correct way?&lt;/P&gt;

&lt;P&gt;Thanks in advance for the help.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:30:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-create-line-chart-using-Time-and-Date/m-p/455508#M128795</guid>
      <dc:creator>kingwaras</dc:creator>
      <dc:date>2020-09-30T00:30:55Z</dc:date>
    </item>
    <item>
      <title>Re: How create line chart using Time and Date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-create-line-chart-using-Time-and-Date/m-p/455509#M128796</link>
      <description>&lt;P&gt;As far as I am aware, you can't make the Y axis in Splunk be non-numeric.  It will split the values into different lines for each timestamp you have there instead of a single line.  &lt;/P&gt;

&lt;P&gt;Documentation: &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.2.5/Viz/LineAreaCharts#Data_formatting"&gt;https://docs.splunk.com/Documentation/Splunk/7.2.5/Viz/LineAreaCharts#Data_formatting&lt;/A&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults count=1 
| eval data="Job_Name,10/12/2018 07:14,10/12/2018,07:14
Job_Name,12/12/2018 07:14,12/12/2018,07:14
Job_Name,13/12/2018 09:04,13/12/2018,09:04
Job_Name,14/12/2018 11:11,14/12/2018,11:11" 
| fields - _time 
| rex field=data max_match=0 "(?&amp;lt;data&amp;gt;[^\n\e]+)" 
| eval data=trim(data) 
| mvexpand data
| rex field=data "(?&amp;lt;SERVICE&amp;gt;[^\,]+),(?&amp;lt;END_TIME&amp;gt;[^\,]+),(?&amp;lt;DATA&amp;gt;[^\,]+),(?&amp;lt;TIME&amp;gt;[^\e]+)"
| eval DATA=strftime(strptime(DATA, "%d/%m/%Y"), "%d-%b-%y")
| eval TIME=strftime(strptime(TIME, "%H:%M"), "%H:%M:%S")
| eval count=1
| xyseries DATA TIME count
&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/7048iD4C711F57766DFB5/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;A timechart would probably be more beneficial, but it won't have that timestamped Y axis and you would need to hover over the visualization to see the minute:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults count=1 
| eval data="Job_Name,10/12/2018 07:14,10/12/2018,07:14
Job_Name,12/12/2018 07:14,12/12/2018,07:14
Job_Name,13/12/2018 09:04,13/12/2018,09:04
Job_Name,14/12/2018 11:11,14/12/2018,11:11" 
| fields - _time 
| rex field=data max_match=0 "(?&amp;lt;data&amp;gt;[^\n\e]+)" 
| eval data=trim(data) 
| mvexpand data
| rex field=data "(?&amp;lt;SERVICE&amp;gt;[^\,]+),(?&amp;lt;END_TIME&amp;gt;[^\,]+),(?&amp;lt;DATA&amp;gt;[^\,]+),(?&amp;lt;TIME&amp;gt;[^\e]+)"
| eval _time=strptime(DATA.TIME, "%d/%m/%Y%H:%M")
| timechart span=1m count
| search count&amp;gt;0
&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/7049i584E84B397B5D369/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 May 2019 15:32:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-create-line-chart-using-Time-and-Date/m-p/455509#M128796</guid>
      <dc:creator>dmarling</dc:creator>
      <dc:date>2019-05-15T15:32:37Z</dc:date>
    </item>
  </channel>
</rss>

