<?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 between the results from two different searches? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-the-difference-between-the-results-from-two/m-p/262000#M78659</link>
    <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"Sending" OR "Receiving" earliest=-7days | rex  "(?&amp;lt;action&amp;gt;Sending|Receiving)" | eval gigabytes=((bytes/1024)/1024) | timechart span=1day avg(gigabytes) as gb by action | eval diff=Sending-Receiving
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 23 May 2016 23:27:09 GMT</pubDate>
    <dc:creator>sundareshr</dc:creator>
    <dc:date>2016-05-23T23:27:09Z</dc:date>
    <item>
      <title>How to display the difference between the results from two different searches?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-the-difference-between-the-results-from-two/m-p/261999#M78658</link>
      <description>&lt;P&gt;I display two different graphs by using the following strings.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"Sending" earliest=-7days | eval gigabytes=((bytes/1024)/1024) | timechart span=1day avg(gigabytes) AS "Gigabytes sent"

"Receiving" earliest=-7days | eval gigabytes=((bytes/1024)/1024) | timechart span=1day avg(gigabytes) AS "Gigabytes received"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I can display both in the same graph by:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"Sending" earliest=-7days | eval gigabytes=((bytes/1024)/1024) | timechart span=1day avg(gigabytes) AS "Gigabytes sent" | appendcols [search "Receiving" earliest=-7days | eval gigabytes=((bytes/1024)/1024) | timechart  span=1day avg(gigabytes) AS "Gigabytes received"]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This gives me two lines (each has a value for one day for the past 7 days).&lt;/P&gt;

&lt;P&gt;How do I display the difference between gigabytes sent and received? I want to display Gigabytes sent - gigabytes received for each day for the past 7 days.&lt;/P&gt;</description>
      <pubDate>Mon, 23 May 2016 23:16:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-the-difference-between-the-results-from-two/m-p/261999#M78658</guid>
      <dc:creator>thewho123</dc:creator>
      <dc:date>2016-05-23T23:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to display the difference between the results from two different searches?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-the-difference-between-the-results-from-two/m-p/262000#M78659</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"Sending" OR "Receiving" earliest=-7days | rex  "(?&amp;lt;action&amp;gt;Sending|Receiving)" | eval gigabytes=((bytes/1024)/1024) | timechart span=1day avg(gigabytes) as gb by action | eval diff=Sending-Receiving
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 23 May 2016 23:27:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-the-difference-between-the-results-from-two/m-p/262000#M78659</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-05-23T23:27:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to display the difference between the results from two different searches?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-the-difference-between-the-results-from-two/m-p/262001#M78660</link>
      <description>&lt;P&gt;Is the syntax correct? I get null for y-axis description.&lt;/P&gt;

&lt;P&gt;Also avg bytes from sending and receiving should be separate. Wouldn't this combine all of them together ?&lt;/P&gt;</description>
      <pubDate>Mon, 23 May 2016 23:34:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-the-difference-between-the-results-from-two/m-p/262001#M78660</guid>
      <dc:creator>thewho123</dc:creator>
      <dc:date>2016-05-23T23:34:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to display the difference between the results from two different searches?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-the-difference-between-the-results-from-two/m-p/262002#M78661</link>
      <description>&lt;P&gt;Do you not see columns for Sending and Receiving? The avg(gb) will be calculated separately for each action. If NULL is the third column, you could add &lt;CODE&gt;usenull=f&lt;/CODE&gt; to the timechart command. You search would look like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myIndex sourcetype=mySourcetype "Sending" OR "Receiving" earliest=-7d@d | rex  "(?&amp;lt;action&amp;gt;Sending|Receiving)" | eval gigabytes=((bytes/1024)/1024) | timechart usenull=f span=1day avg(gigabytes) as gb by action | eval diff=Sending-Receiving
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 May 2016 00:46:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-the-difference-between-the-results-from-two/m-p/262002#M78661</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-05-24T00:46:33Z</dc:date>
    </item>
  </channel>
</rss>

