<?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: Help rebuilding subsearch that keeps timing out in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Help-rebuilding-subsearch-that-keeps-timing-out/m-p/366414#M108089</link>
    <description>&lt;P&gt;That's exactly what I was trying to do!  Thank you!&lt;/P&gt;

&lt;P&gt;I do have another question if you have a moment.&lt;/P&gt;

&lt;P&gt;Is there a way to do an OR in the category eval? (eval Category=if(like(DesktopName,"%CAT1"),"Category1","Category2"))&lt;/P&gt;

&lt;P&gt;If possible I need to look for *CAT1  OR *CAT3 to exclude them both. &lt;/P&gt;</description>
    <pubDate>Thu, 05 Oct 2017 11:56:56 GMT</pubDate>
    <dc:creator>kmaron</dc:creator>
    <dc:date>2017-10-05T11:56:56Z</dc:date>
    <item>
      <title>Help rebuilding subsearch that keeps timing out</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-rebuilding-subsearch-that-keeps-timing-out/m-p/366411#M108086</link>
      <description>&lt;P&gt;So here's my issue.   We are creating a chart that shows each user and which desktops they use.  The desktops are divided into two categories.  I need counts of users for category 2 that are NOT in category 1.  I have created a query that uses a subsearch and it works great with up to 7 days worth of data.  However they're asking for 30 days worth of data and when I bump it up the subsearch is timing out.   &lt;/P&gt;

&lt;P&gt;I've been trying to re-build this without a subsearch but I haven't been able to figure it out yet so I'm asking for some help from the Splunk world.&lt;/P&gt;

&lt;P&gt;Here's my search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=apache_logs host="prod" GET ("URL1" OR "URL2") 
| rex field=_raw " - (?&amp;lt;UserID&amp;gt;.*?) \?desktop=(?&amp;lt;DesktopName&amp;gt;\w+)" 
| search NOT 
    [ search index=apache_logs host="prod" GET ("URL1" OR "URL2") 
    | rex field=_raw " - (?&amp;lt;UserID&amp;gt;.*?) \?desktop=(?&amp;lt;DesktopName&amp;gt;\w+)" 
    | eval DesktopName=upper(DesktopName) 
    | search DesktopName=*CAT1 
    | stats count by UserID
    | fields - count] 
| stats count by UserID DesktopName 
| chart count over UserID by DesktopName
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 04 Oct 2017 20:33:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-rebuilding-subsearch-that-keeps-timing-out/m-p/366411#M108086</guid>
      <dc:creator>kmaron</dc:creator>
      <dc:date>2017-10-04T20:33:41Z</dc:date>
    </item>
    <item>
      <title>Re: Help rebuilding subsearch that keeps timing out</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-rebuilding-subsearch-that-keeps-timing-out/m-p/366412#M108087</link>
      <description>&lt;P&gt;Try this (no subsearch)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=apache_logs host="prod" GET ("URL1" OR "URL2") 
| rex field=_raw " - (?&amp;lt;UserID&amp;gt;.*?) \?desktop=(?&amp;lt;DesktopName&amp;gt;\w+)" 
| eval DesktopName=upper(DesktopName) 
| eval Category=if(like(DesktopName,"%CAT1"),"Category1","Category2")
| stats count values(Category) as Category by UserID DesktopName
| where isnull(mvfilter(match(Category,"Category1")))
| chart count over UserID by DesktopName
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 04 Oct 2017 21:23:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-rebuilding-subsearch-that-keeps-timing-out/m-p/366412#M108087</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-10-04T21:23:36Z</dc:date>
    </item>
    <item>
      <title>Re: Help rebuilding subsearch that keeps timing out</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-rebuilding-subsearch-that-keeps-timing-out/m-p/366413#M108088</link>
      <description>&lt;P&gt;Use @somesoni2's, becauseit is a more complete solution, but...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[search index=apache_logs host="prod" GET ("URL1" OR "URL2") "desktop=*CAT1"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;...probably would have speeded the subsearch up quite a bit.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Oct 2017 22:19:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-rebuilding-subsearch-that-keeps-timing-out/m-p/366413#M108088</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-10-04T22:19:56Z</dc:date>
    </item>
    <item>
      <title>Re: Help rebuilding subsearch that keeps timing out</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-rebuilding-subsearch-that-keeps-timing-out/m-p/366414#M108089</link>
      <description>&lt;P&gt;That's exactly what I was trying to do!  Thank you!&lt;/P&gt;

&lt;P&gt;I do have another question if you have a moment.&lt;/P&gt;

&lt;P&gt;Is there a way to do an OR in the category eval? (eval Category=if(like(DesktopName,"%CAT1"),"Category1","Category2"))&lt;/P&gt;

&lt;P&gt;If possible I need to look for *CAT1  OR *CAT3 to exclude them both. &lt;/P&gt;</description>
      <pubDate>Thu, 05 Oct 2017 11:56:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-rebuilding-subsearch-that-keeps-timing-out/m-p/366414#M108089</guid>
      <dc:creator>kmaron</dc:creator>
      <dc:date>2017-10-05T11:56:56Z</dc:date>
    </item>
    <item>
      <title>Re: Help rebuilding subsearch that keeps timing out</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-rebuilding-subsearch-that-keeps-timing-out/m-p/366415#M108090</link>
      <description>&lt;P&gt;This actually doesn't seem to be working.  I'm still getting results that are in category1 &lt;/P&gt;</description>
      <pubDate>Thu, 05 Oct 2017 14:59:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-rebuilding-subsearch-that-keeps-timing-out/m-p/366415#M108090</guid>
      <dc:creator>kmaron</dc:creator>
      <dc:date>2017-10-05T14:59:19Z</dc:date>
    </item>
  </channel>
</rss>

