<?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 combine the outputs of two searches and display them in a chart? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-the-outputs-of-two-searches-and-display-them-in-a/m-p/199091#M57638</link>
    <description>&lt;P&gt;Hi lguinn,&lt;/P&gt;

&lt;P&gt;Wow, that worked amazingly!&lt;/P&gt;

&lt;P&gt;However, I haven't thought that it would be that (let's say ) advanced, using streamstats and staff. I'll keep that script though in my one-note to be processed for future queries.&lt;/P&gt;

&lt;P&gt;One more question though, how to eliminate 2 lines as you say? I am attempting to keep only dest_ip, critical and high fields but it doesn't work.&lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
Evang&lt;/P&gt;</description>
    <pubDate>Tue, 02 Sep 2014 11:45:28 GMT</pubDate>
    <dc:creator>evang_26</dc:creator>
    <dc:date>2014-09-02T11:45:28Z</dc:date>
    <item>
      <title>How to combine the outputs of two searches and display them in a chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-the-outputs-of-two-searches-and-display-them-in-a/m-p/199089#M57636</link>
      <description>&lt;P&gt;Hi users,&lt;/P&gt;

&lt;P&gt;I am trying to combine the outputs of two different searches and stack them in a chart.&lt;/P&gt;

&lt;P&gt;The idea is to find the most popular IPs in my network based on vulnerability severity high OR critical, and then chart each popular IP with its respective number of vulns (high OR critical).&lt;/P&gt;

&lt;P&gt;Here is how I started dealing with this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=nessus severity=high OR severity=critical earliest=-30d@mon latest=now| top 5 severity,dest_ip|chart sum(count) by dest_ip,severity
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However, the above lists only IPs with severity==high because there are more high vulns for all of the IPs.&lt;/P&gt;

&lt;P&gt;Bearing the above in mind, and hoping that I can still list the most popular IPs (total of high + critical vulns for each IP), I thought combining searches, that is have one to find the most popular IPs (high + critical) and then somehow instruct the other search to take from the listed previously IPs and list how many critical vulns. Below is the attempt:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|set union [search sourcetype=nessus severity=high OR severity=critical  earliest=-30d@mon latest=now| top 5 severity,dest_ip|chart sum(count) by dest_ip,severity] [search sourcetype=nessus severity=critical OR severity=high earliest=-30d@mon latest=now| top 5 severity,dest_ip|  where severity=critical| chart sum(count) by dest_ip,severity]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However, the above lists again only machines with high vulns. Critical ones are missing.&lt;/P&gt;

&lt;P&gt;Could anyone help?&lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
Evang&lt;/P&gt;</description>
      <pubDate>Mon, 01 Sep 2014 19:59:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-the-outputs-of-two-searches-and-display-them-in-a/m-p/199089#M57636</guid>
      <dc:creator>evang_26</dc:creator>
      <dc:date>2014-09-01T19:59:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine the outputs of two searches and display them in a chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-the-outputs-of-two-searches-and-display-them-in-a/m-p/199090#M57637</link>
      <description>&lt;P&gt;Try this approach:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=nessus severity=high OR severity=critical earliest=-30d@mon latest=now
| chart count by dest_ip severity
| sort -high 
| streamstats count as rank_high
| sort -critical
| streamstats count as rank_critical
| where rank_high &amp;lt;= 10 OR rank_critical &amp;lt;=10
| fields - rank_high rank_critical
| addcoltotals high critical
| sort -total
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This approach uses sorting plus &lt;CODE&gt;streamstats&lt;/CODE&gt; to identify the top IPs based on high severity, plus the top based on critical severity. The &lt;CODE&gt;where&lt;/CODE&gt; command keeps the top 10 in &lt;EM&gt;both&lt;/EM&gt; groups. If you show this as a graphic chart, you may want to eliminate the last 2 lines, which calculates an overall total of the two categories.&lt;/P&gt;

&lt;P&gt;This should give you no more than 20 IPs in the resulting chart.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Sep 2014 08:58:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-the-outputs-of-two-searches-and-display-them-in-a/m-p/199090#M57637</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2014-09-02T08:58:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine the outputs of two searches and display them in a chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-the-outputs-of-two-searches-and-display-them-in-a/m-p/199091#M57638</link>
      <description>&lt;P&gt;Hi lguinn,&lt;/P&gt;

&lt;P&gt;Wow, that worked amazingly!&lt;/P&gt;

&lt;P&gt;However, I haven't thought that it would be that (let's say ) advanced, using streamstats and staff. I'll keep that script though in my one-note to be processed for future queries.&lt;/P&gt;

&lt;P&gt;One more question though, how to eliminate 2 lines as you say? I am attempting to keep only dest_ip, critical and high fields but it doesn't work.&lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
Evang&lt;/P&gt;</description>
      <pubDate>Tue, 02 Sep 2014 11:45:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-the-outputs-of-two-searches-and-display-them-in-a/m-p/199091#M57638</guid>
      <dc:creator>evang_26</dc:creator>
      <dc:date>2014-09-02T11:45:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine the outputs of two searches and display them in a chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-the-outputs-of-two-searches-and-display-them-in-a/m-p/199092#M57639</link>
      <description>&lt;P&gt;I think what Iguinn meant was to delete the last two lines of the search string that was posted. Because this just calculates the totals of the columns.&lt;/P&gt;

&lt;P&gt;If you just want to keep certain fields, use the table or fields command after your search to achieve this. For example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | table dest_ip critical high
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 02 Sep 2014 12:01:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-the-outputs-of-two-searches-and-display-them-in-a/m-p/199092#M57639</guid>
      <dc:creator>tom_frotscher</dc:creator>
      <dc:date>2014-09-02T12:01:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine the outputs of two searches and display them in a chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-the-outputs-of-two-searches-and-display-them-in-a/m-p/199093#M57640</link>
      <description>&lt;P&gt;Hi tom_frotscher,&lt;/P&gt;

&lt;P&gt;I tried with both of them,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| fields dest_ip critical high
| table dest_ip critical high
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It didn't worked. I tried also with a fieldnull, same thing.&lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
Evang&lt;/P&gt;</description>
      <pubDate>Tue, 02 Sep 2014 12:09:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-the-outputs-of-two-searches-and-display-them-in-a/m-p/199093#M57640</guid>
      <dc:creator>evang_26</dc:creator>
      <dc:date>2014-09-02T12:09:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine the outputs of two searches and display them in a chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-the-outputs-of-two-searches-and-display-them-in-a/m-p/199094#M57641</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;sourcetype=nessus severity=high OR severity=critical earliest=-30d@mon latest=now&lt;BR /&gt;
| chart count by dest_ip severity&lt;BR /&gt;
| sort -high &lt;BR /&gt;
| streamstats count as rank_high&lt;BR /&gt;
| sort -critical&lt;BR /&gt;
| streamstats count as rank_critical&lt;BR /&gt;
| where rank_high &amp;lt;= 10 OR rank_critical &amp;lt;=10&lt;BR /&gt;
| fields - rank_high rank_critical&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;It is a little complex! You really are combining two independent "Top Tens" - one based on critical severity and the other based on high severity. You could do this with other commands like &lt;CODE&gt;join&lt;/CODE&gt; or &lt;CODE&gt;append&lt;/CODE&gt; but this approach should be much more efficient and work with large data sets.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Sep 2014 17:32:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-the-outputs-of-two-searches-and-display-them-in-a/m-p/199094#M57641</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2014-09-02T17:32:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine the outputs of two searches and display them in a chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-the-outputs-of-two-searches-and-display-them-in-a/m-p/199095#M57642</link>
      <description>&lt;P&gt;That worked!&lt;/P&gt;

&lt;P&gt;Thank you very much indeed lguinn.&lt;/P&gt;

&lt;P&gt;Hope some day I'll be able to help guys like me in the future!&lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
Evang&lt;/P&gt;</description>
      <pubDate>Tue, 02 Sep 2014 18:21:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-the-outputs-of-two-searches-and-display-them-in-a/m-p/199095#M57642</guid>
      <dc:creator>evang_26</dc:creator>
      <dc:date>2014-09-02T18:21:22Z</dc:date>
    </item>
  </channel>
</rss>

