<?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: Comparing Chart Results to field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Comparing-Chart-Results-to-field/m-p/307489#M161552</link>
    <description>&lt;P&gt;You just need to add your first search as subsearch filter in the second search. Since you're filtering based on a field name, the subsearch should return results with a field with same name (rename command added for that).&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;$time_span$ index=dcxx_acs [search $time_span$ index=$nexus_app_dc$ nexus_syslog_level=$nexus_loglevel$ $keyword$ | chart count by host | table host | rename host as Address ] | top limit=50 _time, User, Address, CmdSet | fields - count - percent
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 31 Mar 2017 18:03:11 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2017-03-31T18:03:11Z</dc:date>
    <item>
      <title>Comparing Chart Results to field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-Chart-Results-to-field/m-p/307488#M161551</link>
      <description>&lt;P&gt;This is my first time posting to the community, I hope this answer is not listed somewhere else.. if it is I have been unable to find it.&lt;/P&gt;

&lt;P&gt;I create my own dashboards for everything and I am more or less trying to tackle my first data correlation attempt but so far have come up short.&lt;/P&gt;

&lt;P&gt;The Dashboard I have created uses dynamically generated filters the field I am focused on at the moment is very simple; its "host" and it looks like this:&lt;/P&gt;

&lt;P&gt;(Filter1) &lt;BR /&gt;
$time_span$ index=$nexus_app_dc$ nexus_syslog_level=$nexus_loglevel$ $keyword$ | chart count by host&lt;BR /&gt;&lt;BR /&gt;
(THIS WORKS)&lt;/P&gt;

&lt;P&gt;What I want to do is use the results of this chart to run another search against other data. I will provide an example&lt;/P&gt;

&lt;P&gt;Lets say the chart comes back with the following:&lt;BR /&gt;
"10.0.0.1"&lt;BR /&gt;
"10.0.0.2"&lt;BR /&gt;
"10.0.0.3"&lt;/P&gt;

&lt;P&gt;I only want my next search to contain hosts that are in that list.. here is what I have so far:&lt;/P&gt;

&lt;P&gt;$time_span$ index=dcxx_acs &lt;STRONG&gt;Address=$nexus_app_host$&lt;/STRONG&gt;  | top limit=50 _time, User, Address, CmdSet | fields - count - percent&lt;/P&gt;

&lt;P&gt;I guess in my mind I see it something like the following if I were to write it out manually&lt;/P&gt;

&lt;P&gt;$time_span$ index=dcxx_acs &lt;STRONG&gt;Address=10.0.0.1 OR Address=10.0.0.2 OR Address=10.0.0.3&lt;/STRONG&gt;| top limit=50 _time, User, Address, CmdSet | fields - count - percent&lt;/P&gt;

&lt;P&gt;I hope at least some of this makes sense to some of you guys, any assistance is appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 13:30:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-Chart-Results-to-field/m-p/307488#M161551</guid>
      <dc:creator>jamie_leclair</dc:creator>
      <dc:date>2020-09-29T13:30:07Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Chart Results to field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-Chart-Results-to-field/m-p/307489#M161552</link>
      <description>&lt;P&gt;You just need to add your first search as subsearch filter in the second search. Since you're filtering based on a field name, the subsearch should return results with a field with same name (rename command added for that).&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;$time_span$ index=dcxx_acs [search $time_span$ index=$nexus_app_dc$ nexus_syslog_level=$nexus_loglevel$ $keyword$ | chart count by host | table host | rename host as Address ] | top limit=50 _time, User, Address, CmdSet | fields - count - percent
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 31 Mar 2017 18:03:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-Chart-Results-to-field/m-p/307489#M161552</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-03-31T18:03:11Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Chart Results to field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-Chart-Results-to-field/m-p/307490#M161553</link>
      <description>&lt;P&gt;Wow, that worked... perfectly... I just spent the last hour playing with the map command without any luck.. You're a wizard sir.. and I thank you.&lt;/P&gt;</description>
      <pubDate>Fri, 31 Mar 2017 18:14:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-Chart-Results-to-field/m-p/307490#M161553</guid>
      <dc:creator>jamie_leclair</dc:creator>
      <dc:date>2017-03-31T18:14:57Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Chart Results to field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-Chart-Results-to-field/m-p/307491#M161554</link>
      <description>&lt;P&gt;If your problem is resolved, please accept the answer to help future readers.&lt;/P&gt;</description>
      <pubDate>Fri, 31 Mar 2017 19:32:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-Chart-Results-to-field/m-p/307491#M161554</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2017-03-31T19:32:23Z</dc:date>
    </item>
  </channel>
</rss>

