<?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 How do I pull data from a subsearch? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-pull-data-from-a-subsearch/m-p/236168#M70152</link>
    <description>&lt;P&gt;So I have the following search:&lt;BR /&gt;
&lt;CODE&gt;search host="MY_IP_LIST" index="test" earliest="1/5/2017:00:00:01" latest="1/5/2017:13:00:00"| table src_ip&lt;/CODE&gt;&lt;BR /&gt;
which generates a list of IPs for which I need to search for username's against.&lt;/P&gt;

&lt;P&gt;Normally, for a single IP (e.g. 192.168.0.1) I can run:&lt;BR /&gt;
&lt;CODE&gt;sourcetype=WinEventLog* 192.168.0.1 "EventCode=4624" | table src_ip, user|dedup src_ip, user&lt;/CODE&gt;&lt;BR /&gt;
and I get a list of users that have logged into that system.&lt;/P&gt;

&lt;P&gt;How do I use the results of the IP list from my first search to generate a table with IPs and usernames? I've been trying subsearches but to-date I've been unsuccessful.&lt;/P&gt;

&lt;P&gt;Thank you in advance for the help.&lt;/P&gt;</description>
    <pubDate>Wed, 11 Jan 2017 21:08:45 GMT</pubDate>
    <dc:creator>user12345a_2</dc:creator>
    <dc:date>2017-01-11T21:08:45Z</dc:date>
    <item>
      <title>How do I pull data from a subsearch?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-pull-data-from-a-subsearch/m-p/236168#M70152</link>
      <description>&lt;P&gt;So I have the following search:&lt;BR /&gt;
&lt;CODE&gt;search host="MY_IP_LIST" index="test" earliest="1/5/2017:00:00:01" latest="1/5/2017:13:00:00"| table src_ip&lt;/CODE&gt;&lt;BR /&gt;
which generates a list of IPs for which I need to search for username's against.&lt;/P&gt;

&lt;P&gt;Normally, for a single IP (e.g. 192.168.0.1) I can run:&lt;BR /&gt;
&lt;CODE&gt;sourcetype=WinEventLog* 192.168.0.1 "EventCode=4624" | table src_ip, user|dedup src_ip, user&lt;/CODE&gt;&lt;BR /&gt;
and I get a list of users that have logged into that system.&lt;/P&gt;

&lt;P&gt;How do I use the results of the IP list from my first search to generate a table with IPs and usernames? I've been trying subsearches but to-date I've been unsuccessful.&lt;/P&gt;

&lt;P&gt;Thank you in advance for the help.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2017 21:08:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-pull-data-from-a-subsearch/m-p/236168#M70152</guid>
      <dc:creator>user12345a_2</dc:creator>
      <dc:date>2017-01-11T21:08:45Z</dc:date>
    </item>
    <item>
      <title>Re: How do I pull data from a subsearch?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-pull-data-from-a-subsearch/m-p/236169#M70153</link>
      <description>&lt;P&gt;try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=WinEventLog* "EventCode=4624" [search host="MY_IP_LIST" index="test" earliest="1/5/2017:00:00:01" latest="1/5/2017:13:00:00"| table src_ip|format]| stats count by src_ip, user|fields - count
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 11 Jan 2017 21:15:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-pull-data-from-a-subsearch/m-p/236169#M70153</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2017-01-11T21:15:43Z</dc:date>
    </item>
    <item>
      <title>Re: How do I pull data from a subsearch?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-pull-data-from-a-subsearch/m-p/236170#M70154</link>
      <description>&lt;P&gt;Can you try this below:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=WinEventLog* "EventCode=4624" earliest="1/5/2017:00:00:01" latest="1/5/2017:13:00:00"
[ search host="MY_IP_LIST" index="test" earliest="1/5/2017:00:00:01" latest="1/5/2017:13:00:00"| dedup src_ip| table src_ip ]
| table src_ip, user
|dedup src_ip, user
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 11 Jan 2017 21:18:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-pull-data-from-a-subsearch/m-p/236170#M70154</guid>
      <dc:creator>gokadroid</dc:creator>
      <dc:date>2017-01-11T21:18:16Z</dc:date>
    </item>
    <item>
      <title>Re: How do I pull data from a subsearch?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-pull-data-from-a-subsearch/m-p/236171#M70155</link>
      <description>&lt;P&gt;You really need to know the field name for the IP in the second search. The single field output from the first search needs to match that. Assuming you have a field named src_ip in the second set of logs:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[ search host="MY_IP_LIST" index="test" earliest="1/5/2017:00:00:01" latest="1/5/2017:13:00:00"
    | table src_ip
] sourcetype=WinEventLog* "EventCode=4624" 
| table src_ip, user
| dedup src_ip, user
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will essentially create a list of &lt;CODE&gt;(src_ip=something OR src_ip=somethingelse ....)&lt;/CODE&gt; representing all your src_ips and insert that into your search string.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2017 21:20:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-pull-data-from-a-subsearch/m-p/236171#M70155</guid>
      <dc:creator>twinspop</dc:creator>
      <dc:date>2017-01-11T21:20:47Z</dc:date>
    </item>
  </channel>
</rss>

