<?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 display the difference of results by source as a single value ,along with trending arrow of difference in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-the-difference-of-results-by-source-as-a-single/m-p/465017#M191657</link>
    <description>&lt;P&gt;@to4kawa Thank you. It perfectly worked for me.&lt;/P&gt;</description>
    <pubDate>Wed, 23 Oct 2019 15:00:48 GMT</pubDate>
    <dc:creator>avni26</dc:creator>
    <dc:date>2019-10-23T15:00:48Z</dc:date>
    <item>
      <title>How to display the difference of results by source as a single value ,along with trending arrow of difference</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-the-difference-of-results-by-source-as-a-single/m-p/465014#M191654</link>
      <description>&lt;P&gt;Hi Team,&lt;BR /&gt;
I have multiple sources in sourcetype. Want to see difference of result from last two sources. Latest source is "date_10162019.csv", and last source is "data_10102019.csv"&lt;BR /&gt;
I am calculating the result based on latest source and before latest source of a sourcetype from below. And I have to show in trend with difference in up /down arrow.&lt;BR /&gt;
index="idx" sourcetype=xyz [| search index="idx" sourcetype=xyz| table source,_time,sourcetype,host | dedup source | sort -_time | head 2 | table source] &lt;BR /&gt;
| table _time "Application Name", source,Status,Environment,sm&lt;BR /&gt;
|  eval status = (some eval condition)&lt;BR /&gt;
| eval deploy = (some condition)&lt;BR /&gt;
| search "Status" = Eligible AND "Environment" = &lt;EM&gt;Dev&lt;/EM&gt; &lt;BR /&gt;
| stats sum(status) as status_sm, sum(deploy) as build ,  count as count by source &lt;BR /&gt;
| eval count= count - ( status_sm + build)&lt;BR /&gt;
| eval per= round((sm)*100/count) &lt;BR /&gt;
| table source per&lt;/P&gt;

&lt;P&gt;Output is like &lt;BR /&gt;
source  per&lt;BR /&gt;
data_10162019.csv   89&lt;BR /&gt;
data_10102019.csv   60&lt;/P&gt;

&lt;P&gt;I want to show this result in trend , as single value showing latest source output (i.e 89) and in arrow sowing their difference (i.e 29).&lt;BR /&gt;
Please help.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 02:41:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-the-difference-of-results-by-source-as-a-single/m-p/465014#M191654</guid>
      <dc:creator>avni26</dc:creator>
      <dc:date>2020-09-30T02:41:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to display the difference of results by source as a single value ,along with trending arrow of difference</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-the-difference-of-results-by-source-as-a-single/m-p/465015#M191655</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| stats count
| eval _raw="source,per
data_10162019.csv,89
data_10102019.csv,60"
| multikv forceheader=1
| table source per
| rex field=source "data_(?&amp;lt;time&amp;gt;\d+)"
| eval _time=strptime(time,"%m%d%Y")
| fields _time per source
| sort _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hi, this is sample query.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="idx" sourcetype=xyz [| search index="idx" sourcetype=xyz
| table source,_time,sourcetype,host 
| dedup source | sort -_time | head 2 | table source]
| table _time "Application Name", source,Status,Environment,sm
| eval status = (some eval condition)
| eval deploy = (some condition)
| search "Status" = Eligible AND "Environment" = Dev
| stats sum(status) as status_sm, sum(deploy) as build , count as count by source
| eval count= count - ( status_sm + build)
| eval per= round((sm)*100/count)
| table source per
| rex field=source "data_(?&amp;lt;time&amp;gt;\d+)"
| eval _time=strptime(time,"%m%d%Y")
| fields _time per source
| sort _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;how about this?&lt;BR /&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/7842iF43DA06D7816A4F7/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, 23 Oct 2019 13:27:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-the-difference-of-results-by-source-as-a-single/m-p/465015#M191655</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2019-10-23T13:27:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to display the difference of results by source as a single value ,along with trending arrow of difference</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-the-difference-of-results-by-source-as-a-single/m-p/465016#M191656</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;it seems like you want to use a &lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.0/Search/Addsparklinestosearchresults"&gt;sparkline&lt;/A&gt; in a &lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.0/Viz/SingleValueFormatting"&gt;single value visualization&lt;/A&gt;. The second link gives the most important information about it, namely that you need to use the timechart command to be able to get your desired visualization. (You've been using table instead.)&lt;/P&gt;</description>
      <pubDate>Wed, 23 Oct 2019 13:34:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-the-difference-of-results-by-source-as-a-single/m-p/465016#M191656</guid>
      <dc:creator>dpeukert</dc:creator>
      <dc:date>2019-10-23T13:34:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to display the difference of results by source as a single value ,along with trending arrow of difference</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-the-difference-of-results-by-source-as-a-single/m-p/465017#M191657</link>
      <description>&lt;P&gt;@to4kawa Thank you. It perfectly worked for me.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Oct 2019 15:00:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-the-difference-of-results-by-source-as-a-single/m-p/465017#M191657</guid>
      <dc:creator>avni26</dc:creator>
      <dc:date>2019-10-23T15:00:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to display the difference of results by source as a single value ,along with trending arrow of difference</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-the-difference-of-results-by-source-as-a-single/m-p/465018#M191658</link>
      <description>&lt;P&gt;Hi @to4kawa &lt;BR /&gt;
There is another requirement to show trend in last column of table. I have table showing user , result from last source and from latest source. Now want to take difference of results and display in last column in trend. Please help.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Oct 2019 11:07:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-the-difference-of-results-by-source-as-a-single/m-p/465018#M191658</guid>
      <dc:creator>avni26</dc:creator>
      <dc:date>2019-10-29T11:07:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to display the difference of results by source as a single value ,along with trending arrow of difference</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-the-difference-of-results-by-source-as-a-single/m-p/465019#M191659</link>
      <description>&lt;P&gt;Without a sample log, it's hard to understand.&lt;BR /&gt;
Can you ask me another question?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Oct 2019 14:17:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-the-difference-of-results-by-source-as-a-single/m-p/465019#M191659</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2019-10-29T14:17:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to display the difference of results by source as a single value ,along with trending arrow of difference</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-the-difference-of-results-by-source-as-a-single/m-p/465020#M191660</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/184221"&gt;@to4kawa&lt;/a&gt;  ,&lt;/P&gt;

&lt;H1&gt;Sample Output&lt;/H1&gt;

&lt;P&gt;user      latest_source_perc     last_source_perc  difference&lt;BR /&gt;
xyz                 76                                70                        6&lt;BR /&gt;
abc                 86                                82                        4&lt;/P&gt;

&lt;P&gt;Wanted to show the output like this (where last column will show trend with arrow or sparkline)&lt;BR /&gt;
user      latest_source_perc     trend_with arrow&lt;BR /&gt;
xyz                 76                                76&lt;BR /&gt;
                                                              6&lt;BR /&gt;
abc                 86                                82&lt;BR /&gt;&lt;BR /&gt;
                                                               4&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 02:43:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-the-difference-of-results-by-source-as-a-single/m-p/465020#M191660</guid>
      <dc:creator>avni26</dc:creator>
      <dc:date>2020-09-30T02:43:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to display the difference of results by source as a single value ,along with trending arrow of difference</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-the-difference-of-results-by-source-as-a-single/m-p/465021#M191661</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;&amp;lt;dashboard&amp;gt;
  &amp;lt;label&amp;gt;test2&amp;lt;/label&amp;gt;
    &amp;lt;search id="baseSearch"&amp;gt;
    &amp;lt;query&amp;gt;
      | stats count
| eval _raw="user,latest_source_perc,last_source_perc,difference
xyz,76,70,6
abc,86,82,4"
| multikv forceheader=1
| table user last_source_perc latest_source_perc 
    &amp;lt;/query&amp;gt;
  &amp;lt;/search&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;title&amp;gt;Base Seach Result&amp;lt;/title&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;search base="baseSearch"&amp;gt;
          &amp;lt;query&amp;gt;| transpose&amp;lt;/query&amp;gt;
        &amp;lt;/search&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;title&amp;gt;xyz&amp;lt;/title&amp;gt;
      &amp;lt;single&amp;gt;
        &amp;lt;search base="baseSearch"&amp;gt;
          &amp;lt;query&amp;gt;| transpose
| fields "row 1"
| streamstats count as _time
| where _time!=1&amp;lt;/query&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;/single&amp;gt;
    &amp;lt;/panel&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;title&amp;gt;abc&amp;lt;/title&amp;gt;
      &amp;lt;single&amp;gt;
        &amp;lt;search base="baseSearch"&amp;gt;
          &amp;lt;query&amp;gt;| transpose
| fields "row 2"
| streamstats count as _time
| where _time!=1&amp;lt;/query&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;/single&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/dashboard&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Oct 2019 15:22:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-the-difference-of-results-by-source-as-a-single/m-p/465021#M191661</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2019-10-29T15:22:44Z</dc:date>
    </item>
  </channel>
</rss>

