<?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: Splunk query compare two results in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-query-compare-two-results/m-p/467171#M30661</link>
    <description>&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/791565/simple-xml-i-want-to-create-cool-single-value-disp.html"&gt;simple-xml-i-want-to-create-cool-single-value-disp&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;as you like.&lt;/P&gt;</description>
    <pubDate>Sat, 21 Dec 2019 07:44:18 GMT</pubDate>
    <dc:creator>to4kawa</dc:creator>
    <dc:date>2019-12-21T07:44:18Z</dc:date>
    <item>
      <title>Splunk query compare two results</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-query-compare-two-results/m-p/467166#M30656</link>
      <description>&lt;P&gt;Guys,&lt;/P&gt;

&lt;P&gt;I have the query below in simple Single Value format:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index = event_viewer "collection = PerfMon" | timechart span = 10m count as PerfMon
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I need to compare the current value with the last 30 minutes and if it has a difference of more than 50% turn red, this is for values ​​above or below.&lt;/P&gt;

&lt;P&gt;Ex: 15:00 -&amp;gt; 1300&lt;BR /&gt;
    3:30 pm -&amp;gt; 1800&lt;BR /&gt;
    4:00 pm -&amp;gt; 3600&lt;/P&gt;

&lt;P&gt;My Single Value chart must be red at exactly 16:00.&lt;/P&gt;

&lt;P&gt;If it is not clear, please let me know.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2019 19:49:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-query-compare-two-results/m-p/467166#M30656</guid>
      <dc:creator>leandromatperei</dc:creator>
      <dc:date>2019-12-17T19:49:07Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk query compare two results</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-query-compare-two-results/m-p/467167#M30657</link>
      <description>&lt;P&gt;index = _internal component=Metrics earliest=-60m@m latest=-30m@m | stats count as OldMetrics&lt;BR /&gt;
| appendcols &lt;BR /&gt;
[search  index = _internal component=Metrics earliest=-30m@m latest=now | stats count as LatestMetrics]&lt;BR /&gt;
| eval deviation=round(OldMetrics/LatestMetrics,2),deviation=1-deviation&lt;BR /&gt;
| eval alert=case(deviation&amp;lt;-0.5,"Yes",deviation&amp;gt;-.05 AND deviation&amp;lt;0.5,"No",deviation&amp;gt;0.5,"Yes")&lt;/P&gt;

&lt;P&gt;That should give you an example of how you can compare two values across two time periods. For your use case you'd want to format the single value to be red if deviation is between -0.5 and 0.5 (hence you can use the alert field) - if you need to use numeric values cause formatting doesn't let you use Yes/No, then use replace those in the search&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2019 20:29:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-query-compare-two-results/m-p/467167#M30657</guid>
      <dc:creator>martynoconnor</dc:creator>
      <dc:date>2019-12-17T20:29:35Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk query compare two results</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-query-compare-two-results/m-p/467168#M30658</link>
      <description>&lt;P&gt;And how can I make this result show me a Single Value in the Preview option?&lt;/P&gt;

&lt;P&gt;I need to add the return difference in a Dashboard. &lt;/P&gt;

&lt;P&gt;Ex: Below 50% difference turns green, above it turns red.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2019 01:23:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-query-compare-two-results/m-p/467168#M30658</guid>
      <dc:creator>leandromatperei</dc:creator>
      <dc:date>2019-12-18T01:23:27Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk query compare two results</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-query-compare-two-results/m-p/467169#M30659</link>
      <description>&lt;P&gt;Guys can anyone give a help in this part?&lt;/P&gt;</description>
      <pubDate>Fri, 20 Dec 2019 21:18:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-query-compare-two-results/m-p/467169#M30659</guid>
      <dc:creator>leandromatperei</dc:creator>
      <dc:date>2019-12-20T21:18:31Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk query compare two results</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-query-compare-two-results/m-p/467170#M30660</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
  &amp;lt;fieldset submitButton="true" autoRun="true"&amp;gt;
    &amp;lt;input type="time" token="field1"&amp;gt;
      &amp;lt;label&amp;gt;&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;
        &amp;lt;earliest&amp;gt;-24h@h&amp;lt;/earliest&amp;gt;
        &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
      &amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;| makeresults count=2
| streamstats count
| eval _time = if (count==2,relative_time(_time,"-2h@m"), relative_time(_time,"@m")) 
| makecontinuous span=1m _time
| eval count=random() % 200
| timechart span=10m sum(count) as PerfMon
| rename COMMENT as "From here, the logic is"
| streamstats list(PerfMon) as PM window=4
| eval PM_30min=if(mvcount(PM)==4,mvindex(PM,0),NULL)
| reverse
| table _time PerfMon PM_30min |head 1|eval range=if(PerfMon / PM_30min &amp;gt; 2 OR PerfMon / PM_30min &amp;lt; 0.5 , "#FF0000" , "#008000")&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;-24h@h&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
          &amp;lt;done&amp;gt;
            &amp;lt;condition&amp;gt;
              &amp;lt;set token="value"&amp;gt;$result.PerfMon$&amp;lt;/set&amp;gt;
              &amp;lt;set token="color"&amp;gt;$result.range$&amp;lt;/set&amp;gt;
            &amp;lt;/condition&amp;gt;
          &amp;lt;/done&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;html id="test"&amp;gt;
        &amp;lt;head&amp;gt;
          &amp;lt;style&amp;gt;
            #test {height:200px;}

p {display:block;
   color: $color$;
   font-size: 12ex;}
&amp;lt;/style&amp;gt;
        &amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
  &amp;lt;div id="sample"&amp;gt;
&amp;lt;p&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;/br&amp;gt;
  $value$&amp;lt;/p&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;/body&amp;gt;
      &amp;lt;/html&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It is difficult because rangemap related options are gone with single value.&lt;BR /&gt;
I made it with html instead. But it's NOT cool.&lt;/P&gt;

&lt;P&gt;Would someone please make it cool.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Dec 2019 23:50:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-query-compare-two-results/m-p/467170#M30660</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2019-12-20T23:50:17Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk query compare two results</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-query-compare-two-results/m-p/467171#M30661</link>
      <description>&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/791565/simple-xml-i-want-to-create-cool-single-value-disp.html"&gt;simple-xml-i-want-to-create-cool-single-value-disp&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;as you like.&lt;/P&gt;</description>
      <pubDate>Sat, 21 Dec 2019 07:44:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-query-compare-two-results/m-p/467171#M30661</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2019-12-21T07:44:18Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk query compare two results</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-query-compare-two-results/m-p/467172#M30662</link>
      <description>&lt;P&gt;The issue you might have is that colouring on single values is for ranges. You're looking for deviation percentage, whilst also still retaining the actual result in the single value. You could perhaps have two single values next to each other - one is the literal value, and next to it is the percentage deviation. Then you can colour it on a range.&lt;/P&gt;</description>
      <pubDate>Sat, 21 Dec 2019 11:43:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-query-compare-two-results/m-p/467172#M30662</guid>
      <dc:creator>martynoconnor</dc:creator>
      <dc:date>2019-12-21T11:43:53Z</dc:date>
    </item>
  </channel>
</rss>

