<?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 to plot a timechart for calculated value? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-plot-a-timechart-for-calculated-value/m-p/614066#M213398</link>
    <description>&lt;P&gt;hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt; ,Thank you so much,&lt;/P&gt;&lt;P&gt;I tried,&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| bin _time span=1mon
| stats count by _time user&lt;/LI-CODE&gt;&lt;P&gt;I am able to create a chart, but the span is not considered as 1 month, instead it is taking random spans and giving values. Is there any different way to specify span?&lt;/P&gt;</description>
    <pubDate>Thu, 22 Sep 2022 09:02:57 GMT</pubDate>
    <dc:creator>anooshac</dc:creator>
    <dc:date>2022-09-22T09:02:57Z</dc:date>
    <item>
      <title>How to plot a timechart for calculated value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-plot-a-timechart-for-calculated-value/m-p/613716#M213300</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I am calculating a value from data and i want to plot it in a timechart.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| where status!="ABORTED"
| streamstats count as start reset_on_change=true by status URL
| where start=1
| streamstats count(eval(status=="FAILURE")) as fails by status URL
| eval fails=if(fails=0,null(),fails)
| filldown fails
| stats list(*) as * by fails URL| where mvcount(status) = 2| eval stime=mvindex(TIME, 0) | eval etime=mvindex(TIME,-1) | eval diff=(etime - stime)/3600/1000|timechart span=1mon avg(diff) as MTTR by URL|eval MTTR = round(MTTR,2)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to plot timechart like this but it is not working and it is giving no results found. Is there anything needs to be done to plot a calculated value in a timechart?&lt;/P&gt;</description>
      <pubDate>Tue, 20 Sep 2022 08:39:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-plot-a-timechart-for-calculated-value/m-p/613716#M213300</guid>
      <dc:creator>anooshac</dc:creator>
      <dc:date>2022-09-20T08:39:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to plot a timechart for calculated value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-plot-a-timechart-for-calculated-value/m-p/613717#M213301</link>
      <description>&lt;P&gt;You need to have a _time field in the data to be able to do timechart. If you set _time=stime, then you will at least get some data.&lt;/P&gt;&lt;P&gt;Also, you cannot do the MTTR rounding the way you are doing it, as there is no field as MTTR in a timechart when you split by a field. The columns will be named as the variants of JENKINS_URL&lt;/P&gt;&lt;P&gt;In order to round these, you need to have this logic to round unknown field names after the timechart&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| foreach * [ eval "&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;"=round('&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;', 2) ]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Sep 2022 07:34:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-plot-a-timechart-for-calculated-value/m-p/613717#M213301</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-09-20T07:34:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to plot a timechart for calculated value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-plot-a-timechart-for-calculated-value/m-p/613740#M213304</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;Thank you so much for the information. I will try to use that.&lt;/P&gt;&lt;P&gt;Is there any method so that i can get monthly wise data apart from timechart?&lt;/P&gt;</description>
      <pubDate>Tue, 20 Sep 2022 08:53:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-plot-a-timechart-for-calculated-value/m-p/613740#M213304</guid>
      <dc:creator>anooshac</dc:creator>
      <dc:date>2022-09-20T08:53:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to plot a timechart for calculated value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-plot-a-timechart-for-calculated-value/m-p/613857#M213325</link>
      <description>&lt;P&gt;Short answer - YES !&lt;/P&gt;&lt;P&gt;There are many ways to do almost anything in Splunk, but when dealing with time, there are typically 3 ways to do stats on time&lt;/P&gt;&lt;P&gt;timechart, stats and chart.&lt;/P&gt;&lt;P&gt;Naturally timechart is a simple way to produce time based information, but you can also use&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| bin _time span=1mon
| stats count by _time&lt;/LI-CODE&gt;&lt;P&gt;which will produce the same output as&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| timechart span=1mon count&lt;/LI-CODE&gt;&lt;P&gt;with a column called _time and a column called count&lt;/P&gt;&lt;P&gt;However, if you do&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=audit
| bin _time span=1h
| stats count by _time user&lt;/LI-CODE&gt;&lt;P&gt;and&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=audit
| timechart span=1h count by user&lt;/LI-CODE&gt;&lt;P&gt;You will see a very different row/column output.&lt;/P&gt;&lt;P&gt;timechart will have a column per user all on the same _time row, whereas stats will have 3 columns, _time, user and count, with a repeated time row per user.&lt;/P&gt;&lt;P&gt;So, really to answer your question, you should know what output information you want to achieve and then find the correct SPL to achieve that output.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Sep 2022 22:51:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-plot-a-timechart-for-calculated-value/m-p/613857#M213325</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-09-20T22:51:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to plot a timechart for calculated value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-plot-a-timechart-for-calculated-value/m-p/614066#M213398</link>
      <description>&lt;P&gt;hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt; ,Thank you so much,&lt;/P&gt;&lt;P&gt;I tried,&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| bin _time span=1mon
| stats count by _time user&lt;/LI-CODE&gt;&lt;P&gt;I am able to create a chart, but the span is not considered as 1 month, instead it is taking random spans and giving values. Is there any different way to specify span?&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2022 09:02:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-plot-a-timechart-for-calculated-value/m-p/614066#M213398</guid>
      <dc:creator>anooshac</dc:creator>
      <dc:date>2022-09-22T09:02:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to plot a timechart for calculated value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-plot-a-timechart-for-calculated-value/m-p/614403#M213510</link>
      <description>&lt;P&gt;I'm not sure how you can be getting random spans, as that bin command will bin by a 1 month span and in your statistics tab you will have the _time column showing YYYY-MM (year/month)&lt;/P&gt;&lt;P&gt;Can you post your search and output&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 24 Sep 2022 03:04:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-plot-a-timechart-for-calculated-value/m-p/614403#M213510</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-09-24T03:04:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to plot a timechart for calculated value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-plot-a-timechart-for-calculated-value/m-p/614654#M213611</link>
      <description>&lt;P class="lia-align-left"&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt; I got the time field like this. &lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="2022-09-27_09h47_56.png" style="width: 407px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/21688i431588F1126018B6/image-size/large?v=v2&amp;amp;px=999" role="button" title="2022-09-27_09h47_56.png" alt="2022-09-27_09h47_56.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Sep 2022 04:20:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-plot-a-timechart-for-calculated-value/m-p/614654#M213611</guid>
      <dc:creator>anooshac</dc:creator>
      <dc:date>2022-09-27T04:20:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to plot a timechart for calculated value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-plot-a-timechart-for-calculated-value/m-p/614691#M213631</link>
      <description>&lt;P&gt;There is nothing wrong with that set of dates, I assume there is a user against each row.&lt;/P&gt;&lt;P&gt;Is there a reason why you don't use timechart?&lt;/P&gt;&lt;P&gt;When you use bin+stats then it will not give months where there is no data for a user - it would be better to use timechart.&lt;/P&gt;&lt;P&gt;You can use 'makecontinous' command to fill in the 'gaps' but using timechart is the right solution&lt;/P&gt;</description>
      <pubDate>Tue, 27 Sep 2022 07:57:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-plot-a-timechart-for-calculated-value/m-p/614691#M213631</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-09-27T07:57:37Z</dc:date>
    </item>
  </channel>
</rss>

