<?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: Extract user list and use in next query in All Apps and Add-ons</title>
    <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Extract-user-list-and-use-in-next-query/m-p/138889#M11821</link>
    <description>&lt;P&gt;That works to input a field into a more limited search.  Is there a way to port those results into a wider search.  Like back into index=* UserNameList&lt;/P&gt;</description>
    <pubDate>Wed, 05 Feb 2014 19:18:07 GMT</pubDate>
    <dc:creator>MattQ</dc:creator>
    <dc:date>2014-02-05T19:18:07Z</dc:date>
    <item>
      <title>Extract user list and use in next query</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Extract-user-list-and-use-in-next-query/m-p/138887#M11819</link>
      <description>&lt;P&gt;I have a search that returns a number of UserNames.   I would like to extract just the usernames [field:UserName] from the search results and then do a follow on search for all the items that have those usernames in them. &lt;/P&gt;

&lt;P&gt;Search and return 'ListOfUsers' &lt;BR /&gt;
Use 'ListOfUsers' to Search index=* (or separate broad search) to return ALL activity from 'ListOfUsers'&lt;/P&gt;</description>
      <pubDate>Wed, 05 Feb 2014 19:11:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Extract-user-list-and-use-in-next-query/m-p/138887#M11819</guid>
      <dc:creator>MattQ</dc:creator>
      <dc:date>2014-02-05T19:11:52Z</dc:date>
    </item>
    <item>
      <title>Re: Extract user list and use in next query</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Extract-user-list-and-use-in-next-query/m-p/138888#M11820</link>
      <description>&lt;P&gt;This is a great use case for a subsearch. You would have your entire search be:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[search &amp;lt;search criteria for the list of users&amp;gt; | fields UserName] &amp;lt;search for activities&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The subsearch will output a series usernames that are then criteria for the broader search. Make sure you start your subsearch with "search." &lt;/P&gt;</description>
      <pubDate>Wed, 05 Feb 2014 19:14:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Extract-user-list-and-use-in-next-query/m-p/138888#M11820</guid>
      <dc:creator>David</dc:creator>
      <dc:date>2014-02-05T19:14:35Z</dc:date>
    </item>
    <item>
      <title>Re: Extract user list and use in next query</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Extract-user-list-and-use-in-next-query/m-p/138889#M11821</link>
      <description>&lt;P&gt;That works to input a field into a more limited search.  Is there a way to port those results into a wider search.  Like back into index=* UserNameList&lt;/P&gt;</description>
      <pubDate>Wed, 05 Feb 2014 19:18:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Extract-user-list-and-use-in-next-query/m-p/138889#M11821</guid>
      <dc:creator>MattQ</dc:creator>
      <dc:date>2014-02-05T19:18:07Z</dc:date>
    </item>
    <item>
      <title>Re: Extract user list and use in next query</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Extract-user-list-and-use-in-next-query/m-p/138890#M11822</link>
      <description>&lt;P&gt;Sure.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=* [ search your_search_for_users | table UserName ] | do_other_things
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But.... subsearches are inefficient, since they consume 2 cpus per execution. A nicer way would be to keep a lookup of users, and then use the lookup in the search.&lt;/P&gt;

&lt;P&gt;The Saved Search that runs every so often:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=whatever find_your_users | table UserName | outputlookup interesting_users.csv
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then use it in a "sub-searchy" kind of way.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=* other_criteria [ | inputlookup interesting_users.csv | table UserName ]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 05 Feb 2014 19:32:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Extract-user-list-and-use-in-next-query/m-p/138890#M11822</guid>
      <dc:creator>alacercogitatus</dc:creator>
      <dc:date>2014-02-05T19:32:30Z</dc:date>
    </item>
  </channel>
</rss>

