<?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: Limit Results with CSV in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Limit-Results-with-CSV/m-p/192192#M38327</link>
    <description>&lt;P&gt;This is actually pretty easy using &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Search/Aboutsubsearches"&gt;subsearches&lt;/A&gt; provided you are within limits as listed on that page. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=prod_index sourcetype=MySource 
| rex field=_raw "&amp;amp;lt;&amp;amp;lt;LOT OF COMPLEX REGEX&amp;amp;gt;&amp;amp;gt;(?&amp;amp;lt;appname&amp;amp;gt;[^]]) (?&amp;amp;lt;userName&amp;amp;gt;[^]])"
| where [inputlookup UserList.csv | rename "Garbage Name" as userName | fields userName]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The results of the subsearch gets expanded into a search expression ((userName="foo") OR (userName="bar") ... ) and put into the parent search. &lt;/P&gt;

&lt;P&gt;Additionally, if you're able to build a field extractions in MySource and get rid of the rex command you can even simplify this further to a single search expression:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=prod_index sourcetype=MySource [inputlookup UserList.csv | rename "Garbage Name" as userName | fields userName]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 11 May 2015 16:02:31 GMT</pubDate>
    <dc:creator>acharlieh</dc:creator>
    <dc:date>2015-05-11T16:02:31Z</dc:date>
    <item>
      <title>Limit Results with CSV</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Limit-Results-with-CSV/m-p/192190#M38325</link>
      <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;

&lt;P&gt;I have run into a problem I am not able to easily solve with Splunk.   I have splunk query that returns some data, user name, appname, and app time accessed.  This returns results for all users.&lt;/P&gt;

&lt;P&gt;I separately have a list of users.  I am trying to find the fields listed above for the list of users.  I have uploaded the list of users both as file and lookup.   I am not able to get the search to only return the list of users.  search info below.  Thanks!&lt;/P&gt;

&lt;P&gt;index=prod_index sourcetype=MySource  | rex field=_raw "&amp;lt;&amp;lt;LOT OF COMPLEX REGEX&amp;gt;&amp;gt;(?&amp;lt;appname&amp;gt;[^]]&lt;EM&gt;) (?&amp;lt;userName&amp;gt;[^]]&lt;/EM&gt;)"&lt;BR /&gt;
AND&lt;BR /&gt;
|inputlookup UserList.csv | rename "Garbage Name" as userName&lt;/P&gt;

&lt;P&gt;I can not figure out how to get these two searches to merged.  Any help would be great thanks!  &lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:56:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Limit-Results-with-CSV/m-p/192190#M38325</guid>
      <dc:creator>nspatel</dc:creator>
      <dc:date>2020-09-28T19:56:36Z</dc:date>
    </item>
    <item>
      <title>Re: Limit Results with CSV</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Limit-Results-with-CSV/m-p/192191#M38326</link>
      <description>&lt;P&gt;index=prod_index sourcetype=MySource | rex field=_raw "&amp;lt;&amp;lt;LOT OF COMPLEX REGEX&amp;gt;&amp;gt;(?&amp;lt;appname&amp;gt;[^]]) (?&amp;lt;userName&amp;gt;[^]])" | fields appname, userName, date | join userName[|inputlookup UserList.csv  | rename "Garbage Name" as userName] &lt;/P&gt;

&lt;P&gt;Seem to do it thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:56:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Limit-Results-with-CSV/m-p/192191#M38326</guid>
      <dc:creator>nspatel</dc:creator>
      <dc:date>2020-09-28T19:56:38Z</dc:date>
    </item>
    <item>
      <title>Re: Limit Results with CSV</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Limit-Results-with-CSV/m-p/192192#M38327</link>
      <description>&lt;P&gt;This is actually pretty easy using &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Search/Aboutsubsearches"&gt;subsearches&lt;/A&gt; provided you are within limits as listed on that page. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=prod_index sourcetype=MySource 
| rex field=_raw "&amp;amp;lt;&amp;amp;lt;LOT OF COMPLEX REGEX&amp;amp;gt;&amp;amp;gt;(?&amp;amp;lt;appname&amp;amp;gt;[^]]) (?&amp;amp;lt;userName&amp;amp;gt;[^]])"
| where [inputlookup UserList.csv | rename "Garbage Name" as userName | fields userName]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The results of the subsearch gets expanded into a search expression ((userName="foo") OR (userName="bar") ... ) and put into the parent search. &lt;/P&gt;

&lt;P&gt;Additionally, if you're able to build a field extractions in MySource and get rid of the rex command you can even simplify this further to a single search expression:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=prod_index sourcetype=MySource [inputlookup UserList.csv | rename "Garbage Name" as userName | fields userName]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 May 2015 16:02:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Limit-Results-with-CSV/m-p/192192#M38327</guid>
      <dc:creator>acharlieh</dc:creator>
      <dc:date>2015-05-11T16:02:31Z</dc:date>
    </item>
  </channel>
</rss>

