<?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 Percentage chart in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Percentage-chart/m-p/499437#M194993</link>
    <description>&lt;P&gt;Hi.&lt;BR /&gt;
I have a query that makes the difference of a query comparing today with last week.&lt;/P&gt;

&lt;P&gt;I would like to generate a graph of percentage difference between the two, could someone help me?&lt;/P&gt;

&lt;P&gt;My chart generates a timeline with events, however I would like a percentage chart.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;earliest=-1w-12h latest=-1w index="raw_teste" (host=host1OR host=host2) "Retrieving message #"
| bucket _time span=20m | eval time=strftime(_time, "%H:%M") | chart count as "SemanaPassada" by time

| appendcols [search earliest=-12h latest=-5s index="raw_teste" (host=host1OR host=host2) "Retrieving message #" 
| bucket _time span=20m | eval time=strftime(_time, "%H:%M") | chart count as "Hoje" by time]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 29 Nov 2019 19:31:15 GMT</pubDate>
    <dc:creator>leandromatperei</dc:creator>
    <dc:date>2019-11-29T19:31:15Z</dc:date>
    <item>
      <title>Percentage chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Percentage-chart/m-p/499437#M194993</link>
      <description>&lt;P&gt;Hi.&lt;BR /&gt;
I have a query that makes the difference of a query comparing today with last week.&lt;/P&gt;

&lt;P&gt;I would like to generate a graph of percentage difference between the two, could someone help me?&lt;/P&gt;

&lt;P&gt;My chart generates a timeline with events, however I would like a percentage chart.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;earliest=-1w-12h latest=-1w index="raw_teste" (host=host1OR host=host2) "Retrieving message #"
| bucket _time span=20m | eval time=strftime(_time, "%H:%M") | chart count as "SemanaPassada" by time

| appendcols [search earliest=-12h latest=-5s index="raw_teste" (host=host1OR host=host2) "Retrieving message #" 
| bucket _time span=20m | eval time=strftime(_time, "%H:%M") | chart count as "Hoje" by time]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 29 Nov 2019 19:31:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Percentage-chart/m-p/499437#M194993</guid>
      <dc:creator>leandromatperei</dc:creator>
      <dc:date>2019-11-29T19:31:15Z</dc:date>
    </item>
    <item>
      <title>Re: Percentage chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Percentage-chart/m-p/499438#M194994</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| makeresults count=2
| streamstats count
| eval _time = if (count==2,relative_time(_time,"-1w-12h"), relative_time(_time,"-5s"))
| makecontinuous span=20m
| where _time &amp;gt; relative_time(now(),"-12h") OR _time &amp;lt; relative_time(now(),"-1w")
| eval count ="Retrieving message #"
| rename count as _raw
`comment("this is sample data")`
| eval date=if(_time &amp;lt;= relative_time(now(),"-1w"),"SemanaPassada","Hoje")
| stats count by date
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hi, This is sample query.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="raw_teste" (host=host1OR host=host2) "Retrieving message #" ( earliest=-1w-12h latest=-1w) OR (earliest=-12h latest=-5s)
| eval date=if(_time &amp;lt;= relative_time(now(),"-1w"),"SemanaPassada","Hoje")
| stats count by date
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How about this? (Visualisation &amp;gt; Pie Chart)&lt;/P&gt;</description>
      <pubDate>Fri, 29 Nov 2019 23:36:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Percentage-chart/m-p/499438#M194994</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2019-11-29T23:36:18Z</dc:date>
    </item>
    <item>
      <title>Re: Percentage chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Percentage-chart/m-p/499439#M194995</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I would like a percentage number chart comparing these two values, is it possible?&lt;/P&gt;

&lt;P&gt;I need to check two absolute values ​​and see if there is a difference is above 30%&lt;/P&gt;

&lt;P&gt;These values ​​are always comparing today with last week's date on the 01 hour timerange.&lt;/P&gt;</description>
      <pubDate>Sat, 30 Nov 2019 01:10:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Percentage-chart/m-p/499439#M194995</guid>
      <dc:creator>leandromatperei</dc:creator>
      <dc:date>2019-11-30T01:10:57Z</dc:date>
    </item>
    <item>
      <title>Re: Percentage chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Percentage-chart/m-p/499440#M194996</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;I need to check two absolute values ​​and see if there is a difference is above 30%&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;Please tell me the calculation formula&lt;/P&gt;</description>
      <pubDate>Sat, 30 Nov 2019 01:33:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Percentage-chart/m-p/499440#M194996</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2019-11-30T01:33:00Z</dc:date>
    </item>
    <item>
      <title>Re: Percentage chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Percentage-chart/m-p/499441#M194997</link>
      <description>&lt;PRE&gt;&lt;CODE&gt; | makeresults count=2
 | streamstats count
 | eval _time = if (count==2,relative_time(_time,"-1w-12h"), relative_time(_time,"-5s"))
 | makecontinuous span=3m
 | where _time &amp;gt; relative_time(now(),"-12h") OR _time &amp;lt;= relative_time(now(),"-1w")
 | eval count=random() % 2 
 | where count = 1
 `comment("this is sample data")`
 | eval date=if(_time &amp;lt;= relative_time(now(),"-1w"),"SemanaPassada","Hoje")
 | bin span=1h _time
 | eval hours=strftime(_time,"%H%M%S")
 | chart sum(count) as count over hours by date
 | eval Difference= round(abs(SemanaPassada - Hoje) / (SemanaPassada + Hoje),1) * 100
 | eval _time=strptime(hours,"%H%M%S")
 | eval thresh=30
 | table _time Difference thresh
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I don't know well, but is it like this?&lt;/P&gt;

&lt;P&gt;Please try with &lt;STRONG&gt;Line Chart&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;When using it for alerts, change the 15th line to &lt;CODE&gt;where Difference &amp;gt; 30&lt;/CODE&gt;.&lt;/P&gt;

&lt;HR /&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;I would like to generate a graph of percentage difference between the two, could someone help me?&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;I thought it is a chart, because you wrote this. but &lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;where I want a chart of type Single Value?&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults count=2 
| streamstats count 
| eval _time = if (count==2,relative_time(_time,"-1w-12h"), relative_time(_time,"-5s")) 
| makecontinuous span=3m 
| where _time &amp;gt; relative_time(now(),"-12h") OR _time &amp;lt;= relative_time(now(),"-1w") 
| eval count=random() % 2 
| where count = 1 
`comment("this is sample data")`
| eval date=if(_time &amp;lt;= relative_time(now(),"-1w"),"SemanaPassada","Hoje") 
| bin span=1h _time 
| eval hours=strftime(_time,"%H%M%S") 
| chart sum(count) as count over hours by date 
| eval Difference= round(abs(SemanaPassada - Hoje) / (SemanaPassada + Hoje),1) * 100 
| eval _time=strptime(hours,"%H%M%S") 
| table _time Difference
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Please try with Single Value.&lt;/P&gt;

&lt;P&gt;If you just give a number, &lt;CODE&gt;stats&lt;/CODE&gt; is fine, but if you want a change, you need &lt;CODE&gt;timechart&lt;/CODE&gt;, etc.&lt;/P&gt;</description>
      <pubDate>Sat, 30 Nov 2019 01:50:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Percentage-chart/m-p/499441#M194997</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2019-11-30T01:50:04Z</dc:date>
    </item>
    <item>
      <title>Re: Percentage chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Percentage-chart/m-p/499442#M194998</link>
      <description>&lt;P&gt;I don't think I understood your last appointment well.&lt;/P&gt;

&lt;P&gt;For example in the query below how would I do to calculate the percentage difference where I want a chart of type Single Value?&lt;/P&gt;

&lt;P&gt;Could you show me.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=* ( earliest=-1w-12h latest=-1w) OR (earliest=-12h latest=-5s)
 | eval date=if(_time &amp;lt;= relative_time(now(),"-1w"),"SemanaPassada","Hoje")
 | stats count by date
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 30 Nov 2019 14:04:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Percentage-chart/m-p/499442#M194998</guid>
      <dc:creator>leandromatperei</dc:creator>
      <dc:date>2019-11-30T14:04:35Z</dc:date>
    </item>
    <item>
      <title>Re: Percentage chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Percentage-chart/m-p/499443#M194999</link>
      <description>&lt;P&gt;I amended answer.&lt;/P&gt;

&lt;P&gt;Please tell me the calculation formula.&lt;/P&gt;

&lt;P&gt;last_week - today?&lt;/P&gt;</description>
      <pubDate>Sat, 30 Nov 2019 22:42:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Percentage-chart/m-p/499443#M194999</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2019-11-30T22:42:41Z</dc:date>
    </item>
    <item>
      <title>Re: Percentage chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Percentage-chart/m-p/499444#M195000</link>
      <description>&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;I need to calculate the difference in values ​​between last week and today in the 01 hour range.&lt;/P&gt;

&lt;P&gt;I need a &lt;STRONG&gt;single value chart&lt;/STRONG&gt; and if it goes above 30% it turns red.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=main ( earliest=-1w-1h latest=-1w) OR (earliest=-1h latest=-5s) | eval date=if(_time &amp;lt;= relative_time(now(),"-1w"),"SemanaPassada","Hoje") 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The calculation can be from last week - today.&lt;/P&gt;</description>
      <pubDate>Sun, 01 Dec 2019 00:45:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Percentage-chart/m-p/499444#M195000</guid>
      <dc:creator>leandromatperei</dc:creator>
      <dc:date>2019-12-01T00:45:22Z</dc:date>
    </item>
    <item>
      <title>Re: Percentage chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Percentage-chart/m-p/499445#M195001</link>
      <description>&lt;P&gt;please check my &lt;STRONG&gt;last Answer&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;the calculation is &lt;CODE&gt;eval Difference&lt;/CODE&gt;&lt;BR /&gt;
if it is wrong, you can change it.&lt;/P&gt;</description>
      <pubDate>Sun, 01 Dec 2019 01:06:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Percentage-chart/m-p/499445#M195001</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2019-12-01T01:06:54Z</dc:date>
    </item>
    <item>
      <title>Re: Percentage chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Percentage-chart/m-p/499446#M195002</link>
      <description>&lt;P&gt;You need the &lt;CODE&gt;timewrap&lt;/CODE&gt; command:&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Timewrap"&gt;https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Timewrap&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 01 Dec 2019 22:37:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Percentage-chart/m-p/499446#M195002</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-12-01T22:37:59Z</dc:date>
    </item>
  </channel>
</rss>

