<?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 Area Chart to show duration between two dates in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Area-Chart-to-show-duration-between-two-dates/m-p/506399#M33663</link>
    <description>&lt;P&gt;Hi Splunkers,&lt;/P&gt;&lt;P&gt;I'm a newbie in Splunk. I'm trying to create a chart to show the duration between two dates (Occurtime and ClearTime but I'm unable to get my desired result.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="t"&gt;Here's my Data:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="t"&gt;Data1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="t"&gt;1593323763.234&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN class="t"&gt;AlarmName=&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN class="t"&gt;Mains&lt;/SPAN&gt; &lt;SPAN class="t"&gt;Input&lt;/SPAN&gt; &lt;SPAN class="t"&gt;Out&lt;/SPAN&gt; &lt;SPAN class="t"&gt;of&lt;/SPAN&gt; &lt;SPAN class="t"&gt;Range&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN class="t"&gt;State=&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN class="t"&gt;Unacknowledged&lt;/SPAN&gt;&lt;SPAN&gt; &amp;amp; &lt;/SPAN&gt;&lt;SPAN class="t"&gt;Cleared&lt;/SPAN&gt;&lt;SPAN&gt;",&lt;/SPAN&gt;&lt;SPAN class="t"&gt;EventType=&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN class="t"&gt;Power&lt;/SPAN&gt; &lt;SPAN class="t"&gt;System&lt;/SPAN&gt;&lt;SPAN&gt;",&lt;/SPAN&gt;&lt;SPAN class="t"&gt;Occurtime=&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN class="t"&gt;2020-06-28&lt;/SPAN&gt; &lt;SPAN class="t"&gt;11:09:42&lt;/SPAN&gt;&lt;SPAN&gt;",&lt;/SPAN&gt;&lt;SPAN class="t"&gt;ClearTime=&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN class="t"&gt;2020-06-28&lt;/SPAN&gt; &lt;SPAN class="t"&gt;17:55:05&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="t"&gt;Data2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="t"&gt;1593323716.209&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;AlarmName=&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN class="t a"&gt;NodeB Unavailable&lt;/SPAN&gt;&lt;SPAN&gt;",&lt;/SPAN&gt;State=&lt;SPAN&gt;"&lt;/SPAN&gt;Unacknowledged&lt;SPAN&gt; &amp;amp; &lt;/SPAN&gt;Cleared&lt;SPAN&gt;",&lt;/SPAN&gt;EventType=&lt;SPAN&gt;"&lt;/SPAN&gt;Running System&lt;SPAN&gt;",&lt;/SPAN&gt;Occurtime=&lt;SPAN&gt;"&lt;/SPAN&gt;2020-06-28 11:59:32&lt;SPAN&gt;",&lt;/SPAN&gt;ClearTime=&lt;SPAN&gt;"&lt;/SPAN&gt;2020-06-28 17:55:13&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my query:&lt;/P&gt;&lt;P&gt;|eval dur_sec=strptime(ClearTime,"%Y-%m-%d %H:%M:%S.%N")-strptime(Occurtime,"%Y-%m-%d %H:%M:%S.%N")&lt;BR /&gt;|eval dur_sec=round((strptime(ClearTime,"%Y-%m-%d %H:%M:%S.%N")-strptime(Occurtime,"%Y-%m-%d %H:%M:%S.%N")))&lt;BR /&gt;|eval duration=tostring(dur_sec,"duration")&lt;BR /&gt;|convert num(duration)&lt;BR /&gt;|eval duration=round(duration/60,2)&lt;BR /&gt;| eval filter=case(&lt;BR /&gt;searchmatch("AC Failure*"),"Power Outage",&lt;BR /&gt;searchmatch("Cell Blocked*"),"Cell Blocked",&lt;BR /&gt;searchmatch("NodeB Unavailable"),"3G Outage",&lt;BR /&gt;searchmatch("eNodeB S1 Control Plane Transmission Interruption"),"4G Outage",1=1,"No Filter match")&lt;BR /&gt;| chart max(duration) over Occurtime by filter&lt;/P&gt;&lt;P&gt;Can anyone help me?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 28 Jun 2020 08:58:37 GMT</pubDate>
    <dc:creator>Noob_splunker</dc:creator>
    <dc:date>2020-06-28T08:58:37Z</dc:date>
    <item>
      <title>Area Chart to show duration between two dates</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Area-Chart-to-show-duration-between-two-dates/m-p/506399#M33663</link>
      <description>&lt;P&gt;Hi Splunkers,&lt;/P&gt;&lt;P&gt;I'm a newbie in Splunk. I'm trying to create a chart to show the duration between two dates (Occurtime and ClearTime but I'm unable to get my desired result.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="t"&gt;Here's my Data:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="t"&gt;Data1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="t"&gt;1593323763.234&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN class="t"&gt;AlarmName=&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN class="t"&gt;Mains&lt;/SPAN&gt; &lt;SPAN class="t"&gt;Input&lt;/SPAN&gt; &lt;SPAN class="t"&gt;Out&lt;/SPAN&gt; &lt;SPAN class="t"&gt;of&lt;/SPAN&gt; &lt;SPAN class="t"&gt;Range&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN class="t"&gt;State=&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN class="t"&gt;Unacknowledged&lt;/SPAN&gt;&lt;SPAN&gt; &amp;amp; &lt;/SPAN&gt;&lt;SPAN class="t"&gt;Cleared&lt;/SPAN&gt;&lt;SPAN&gt;",&lt;/SPAN&gt;&lt;SPAN class="t"&gt;EventType=&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN class="t"&gt;Power&lt;/SPAN&gt; &lt;SPAN class="t"&gt;System&lt;/SPAN&gt;&lt;SPAN&gt;",&lt;/SPAN&gt;&lt;SPAN class="t"&gt;Occurtime=&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN class="t"&gt;2020-06-28&lt;/SPAN&gt; &lt;SPAN class="t"&gt;11:09:42&lt;/SPAN&gt;&lt;SPAN&gt;",&lt;/SPAN&gt;&lt;SPAN class="t"&gt;ClearTime=&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN class="t"&gt;2020-06-28&lt;/SPAN&gt; &lt;SPAN class="t"&gt;17:55:05&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="t"&gt;Data2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="t"&gt;1593323716.209&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;AlarmName=&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN class="t a"&gt;NodeB Unavailable&lt;/SPAN&gt;&lt;SPAN&gt;",&lt;/SPAN&gt;State=&lt;SPAN&gt;"&lt;/SPAN&gt;Unacknowledged&lt;SPAN&gt; &amp;amp; &lt;/SPAN&gt;Cleared&lt;SPAN&gt;",&lt;/SPAN&gt;EventType=&lt;SPAN&gt;"&lt;/SPAN&gt;Running System&lt;SPAN&gt;",&lt;/SPAN&gt;Occurtime=&lt;SPAN&gt;"&lt;/SPAN&gt;2020-06-28 11:59:32&lt;SPAN&gt;",&lt;/SPAN&gt;ClearTime=&lt;SPAN&gt;"&lt;/SPAN&gt;2020-06-28 17:55:13&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my query:&lt;/P&gt;&lt;P&gt;|eval dur_sec=strptime(ClearTime,"%Y-%m-%d %H:%M:%S.%N")-strptime(Occurtime,"%Y-%m-%d %H:%M:%S.%N")&lt;BR /&gt;|eval dur_sec=round((strptime(ClearTime,"%Y-%m-%d %H:%M:%S.%N")-strptime(Occurtime,"%Y-%m-%d %H:%M:%S.%N")))&lt;BR /&gt;|eval duration=tostring(dur_sec,"duration")&lt;BR /&gt;|convert num(duration)&lt;BR /&gt;|eval duration=round(duration/60,2)&lt;BR /&gt;| eval filter=case(&lt;BR /&gt;searchmatch("AC Failure*"),"Power Outage",&lt;BR /&gt;searchmatch("Cell Blocked*"),"Cell Blocked",&lt;BR /&gt;searchmatch("NodeB Unavailable"),"3G Outage",&lt;BR /&gt;searchmatch("eNodeB S1 Control Plane Transmission Interruption"),"4G Outage",1=1,"No Filter match")&lt;BR /&gt;| chart max(duration) over Occurtime by filter&lt;/P&gt;&lt;P&gt;Can anyone help me?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 28 Jun 2020 08:58:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Area-Chart-to-show-duration-between-two-dates/m-p/506399#M33663</guid>
      <dc:creator>Noob_splunker</dc:creator>
      <dc:date>2020-06-28T08:58:37Z</dc:date>
    </item>
    <item>
      <title>Re: Area Chart to show duration between two dates</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Area-Chart-to-show-duration-between-two-dates/m-p/506416#M33666</link>
      <description>&lt;P&gt;What &lt;STRONG&gt;is&lt;/STRONG&gt; your desired result?&amp;nbsp; An area chart requires more than two data points.&lt;/P&gt;&lt;P&gt;This search works with more data points.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval data="1593323763.234,AlarmName=\"Mains Input Out of Range\",State=\"Unacknowledged &amp;amp; Cleared\",EventType=\"Power System\",Occurtime=\"2020-06-28 11:09:42\",ClearTime=\"2020-06-28 17:55:05\"#
1593323716.209,,AlarmName=\"NodeB Unavailable\",State=\"Unacknowledged &amp;amp; Cleared\",EventType=\"Running System\",Occurtime=\"2020-06-28 11:59:32\",ClearTime=\"2020-06-28 17:55:13\"#
1593323710.209,,AlarmName=\"NodeB Unavailable\",State=\"Unacknowledged &amp;amp; Cleared\",EventType=\"Running System\",Occurtime=\"2020-06-28 11:59:26\",ClearTime=\"2020-06-28 17:54:10\"#
1593323706.209,,AlarmName=\"NodeB Unavailable\",State=\"Unacknowledged &amp;amp; Cleared\",EventType=\"Running System\",Occurtime=\"2020-06-28 11:59:16\",ClearTime=\"2020-06-28 16:50:03\"" 
| eval data=split(data,"#") 
| mvexpand data 
| eval _raw=data 
| extract kvdelim=",", pairdelim="=" 
| rex "(?&amp;lt;time&amp;gt;\d+)" 
| eval _time=time 
`comment("Everything above just creates test data")`
| eval duration=round((strptime(ClearTime,"%Y-%m-%d %H:%M:%S.%N")-strptime(Occurtime,"%Y-%m-%d %H:%M:%S.%N"))) 
| eval filter=case(
    searchmatch("AC Failure*"),"Power Outage",
    searchmatch("Cell Blocked*"),"Cell Blocked",
    searchmatch("NodeB Unavailable"),"3G Outage",
    searchmatch("eNodeB S1 Control Plane Transmission Interruption"),"4G Outage",1=1,"No Filter match") 
| chart max(duration) over Occurtime by filter&lt;/LI-CODE&gt;</description>
      <pubDate>Sun, 28 Jun 2020 16:02:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Area-Chart-to-show-duration-between-two-dates/m-p/506416#M33666</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-06-28T16:02:39Z</dc:date>
    </item>
    <item>
      <title>Re: Area Chart to show duration between two dates</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Area-Chart-to-show-duration-between-two-dates/m-p/506427#M33669</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt;&amp;nbsp;thanks for your reply.&amp;nbsp;&lt;/P&gt;&lt;P&gt;My desired result is more of like this.&lt;/P&gt;&lt;P&gt;Y-axis is the duration.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="chart.PNG" style="width: 736px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/9357i81DCCE83589172A7/image-size/large?v=v2&amp;amp;px=999" role="button" title="chart.PNG" alt="chart.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 28 Jun 2020 20:13:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Area-Chart-to-show-duration-between-two-dates/m-p/506427#M33669</guid>
      <dc:creator>Noob_splunker</dc:creator>
      <dc:date>2020-06-28T20:13:04Z</dc:date>
    </item>
    <item>
      <title>Re: Area Chart to show duration between two dates</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Area-Chart-to-show-duration-between-two-dates/m-p/506433#M33671</link>
      <description>You say the Y-axis is the duration, but isn't the X-axis also a duration in the mock-up graph? The distance between Occurtime and ClearTime is the duration. I'm not sure such a graph is possible.</description>
      <pubDate>Sun, 28 Jun 2020 23:54:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Area-Chart-to-show-duration-between-two-dates/m-p/506433#M33671</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-06-28T23:54:47Z</dc:date>
    </item>
    <item>
      <title>Re: Area Chart to show duration between two dates</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Area-Chart-to-show-duration-between-two-dates/m-p/508359#M33823</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/223048"&gt;@Noob_splunker&lt;/a&gt;&amp;nbsp;Please explore &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Viz/ChartEventAnnotations" target="_self"&gt;Chart Event Annotation&lt;/A&gt; or &lt;A href="https://splunkbase.splunk.com/app/4911/" target="_self"&gt;Region Chart Viz&lt;/A&gt; Custom Visualization for your use case. Refer to one of my older answer with run anywhere example for both:&amp;nbsp;&lt;A href="https://community.splunk.com/t5/Dashboards-Visualizations/add-custom-name-in-chart-viz-for-empty-space/m-p/505390#M33512" target="_blank"&gt;https://community.splunk.com/t5/Dashboards-Visualizations/add-custom-name-in-chart-viz-for-empty-space/m-p/505390#M33512&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jul 2020 17:33:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Area-Chart-to-show-duration-between-two-dates/m-p/508359#M33823</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2020-07-09T17:33:13Z</dc:date>
    </item>
  </channel>
</rss>

