<?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 Map and Transaction - long running query in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Map-and-Transaction-long-running-query/m-p/58038#M14173</link>
    <description>&lt;P&gt;Hi all, I'm running a query and the results are taking too long to appear, so I was wondering if you can help me out.&lt;/P&gt;

&lt;P&gt;I've got a set of events that start and stop based on a transaction.&lt;/P&gt;

&lt;P&gt;eg.&lt;BR /&gt;
user1 - starts&lt;BR /&gt;
event = 0&lt;BR /&gt;
user1 - ends&lt;/P&gt;

&lt;P&gt;There's a bit more to it, but essentially that is it.  So i run the transaction command to grab the 3 events and pump out the username into a file.  This part works fine.&lt;/P&gt;

&lt;P&gt;I then use the input lookup file and get the usernames to run a query using the map command.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|inputlookup mylookupfile 
|map search="search
    index=myindex process=ProcessType
    |transaction myusername  startswith=\"starts\" endswith=\"end\"
    |where event=1 and username=$usernameFromLookupFile$"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;My understanding is that map will iteratively go through the values in the inputlookup file and run the query.  I know it's very heavy, but are there any alternatives for what I want to do ?  The inputlookup file contains approximately 10000 usernames.&lt;/P&gt;

&lt;P&gt;Thanks in advance,&lt;/P&gt;

&lt;P&gt;Steve&lt;/P&gt;</description>
    <pubDate>Tue, 12 Mar 2013 02:59:10 GMT</pubDate>
    <dc:creator>stephenho</dc:creator>
    <dc:date>2013-03-12T02:59:10Z</dc:date>
    <item>
      <title>Map and Transaction - long running query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Map-and-Transaction-long-running-query/m-p/58038#M14173</link>
      <description>&lt;P&gt;Hi all, I'm running a query and the results are taking too long to appear, so I was wondering if you can help me out.&lt;/P&gt;

&lt;P&gt;I've got a set of events that start and stop based on a transaction.&lt;/P&gt;

&lt;P&gt;eg.&lt;BR /&gt;
user1 - starts&lt;BR /&gt;
event = 0&lt;BR /&gt;
user1 - ends&lt;/P&gt;

&lt;P&gt;There's a bit more to it, but essentially that is it.  So i run the transaction command to grab the 3 events and pump out the username into a file.  This part works fine.&lt;/P&gt;

&lt;P&gt;I then use the input lookup file and get the usernames to run a query using the map command.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|inputlookup mylookupfile 
|map search="search
    index=myindex process=ProcessType
    |transaction myusername  startswith=\"starts\" endswith=\"end\"
    |where event=1 and username=$usernameFromLookupFile$"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;My understanding is that map will iteratively go through the values in the inputlookup file and run the query.  I know it's very heavy, but are there any alternatives for what I want to do ?  The inputlookup file contains approximately 10000 usernames.&lt;/P&gt;

&lt;P&gt;Thanks in advance,&lt;/P&gt;

&lt;P&gt;Steve&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2013 02:59:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Map-and-Transaction-long-running-query/m-p/58038#M14173</guid>
      <dc:creator>stephenho</dc:creator>
      <dc:date>2013-03-12T02:59:10Z</dc:date>
    </item>
    <item>
      <title>Re: Map and Transaction - long running query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Map-and-Transaction-long-running-query/m-p/58039#M14174</link>
      <description>&lt;P&gt;You're essentially doing a full transaction over your entire index for every single on of the 10000 users, and after building the transactions you filter by username=$foo$ - that's highly inefficient.&lt;/P&gt;

&lt;P&gt;You say you want to dump the usernames into a file - have you considered dropping the inputlookup, running the transaction once, dropping the where username=$foo$, and dumping those usernames into the file? This way you would lose 9999 of your 10000 full transaction queries.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2013 08:26:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Map-and-Transaction-long-running-query/m-p/58039#M14174</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2013-03-12T08:26:25Z</dc:date>
    </item>
    <item>
      <title>Re: Map and Transaction - long running query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Map-and-Transaction-long-running-query/m-p/58040#M14175</link>
      <description>&lt;P&gt;Hi Martin, thanks for the response.  Now that you mention it, it does sound like a good idea. So what you're saying is, run another transaction search with event=1 dump those names into a file and do a NOT IN join over the 2 look up files?&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2013 21:12:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Map-and-Transaction-long-running-query/m-p/58040#M14175</guid>
      <dc:creator>stephenho</dc:creator>
      <dc:date>2013-03-12T21:12:25Z</dc:date>
    </item>
    <item>
      <title>Re: Map and Transaction - long running query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Map-and-Transaction-long-running-query/m-p/58041#M14176</link>
      <description>&lt;P&gt;What you do then depends on your specific use case. If you want to make sure only users in your lookup file make it through you can add a |lookup after the transaction and filter out those that don't exist in the lookup - still only one transaction.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2013 07:50:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Map-and-Transaction-long-running-query/m-p/58041#M14176</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2013-03-13T07:50:41Z</dc:date>
    </item>
  </channel>
</rss>

