<?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: How do I optimize my search? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-optimize-my-search/m-p/280401#M84623</link>
    <description>&lt;P&gt;This one gives me no output other than the _time. Plus it takes longer than before &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 03 Jun 2016 15:45:53 GMT</pubDate>
    <dc:creator>jkalra</dc:creator>
    <dc:date>2016-06-03T15:45:53Z</dc:date>
    <item>
      <title>How do I optimize my search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-optimize-my-search/m-p/280398#M84620</link>
      <description>&lt;P&gt;I have the following search and takes a lot of time to output data. Is there a way to optimize the search?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eventtype=aos_deployment_1_openam_session_start | timechart count as "Auth Start" | appendcols[| search eventtype=aos_deployment_1_openam_session_end | timechart count as "Auth Completion"] | appendcols[| search eventtype=aos_deployment_1_openam_session_failed | timechart count as "Failed Auth"] | fillnull value=0
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 03 Jun 2016 13:50:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-optimize-my-search/m-p/280398#M84620</guid>
      <dc:creator>jkalra</dc:creator>
      <dc:date>2016-06-03T13:50:08Z</dc:date>
    </item>
    <item>
      <title>Re: How do I optimize my search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-optimize-my-search/m-p/280399#M84621</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eventtype=aos_deployment_1_openam_session_start OR eventtype=aos_deployment_1_openam_session_end OR eventtype=aos_deployment_1_openam_session_failed | eval et=split(eventtype, "_") | eval status=mvindex(et, mvcount(et)-1) | stats count by status | rename start AS "Auth Start" end AS "Auth Completion" failed AS "Failed Auth"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 03 Jun 2016 14:02:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-optimize-my-search/m-p/280399#M84621</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-06-03T14:02:59Z</dc:date>
    </item>
    <item>
      <title>Re: How do I optimize my search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-optimize-my-search/m-p/280400#M84622</link>
      <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eventtype=aos_deployment_1_openam_session_start OR eventtype=aos_deployment_1_openam_session_end OR eventtype=aos_deployment_1_openam_session_failed | timechart count by eventtype | fillnull value=0
| rename aos_deployment_1_openam_session_start as "Auth Start" aos_deployment_1_openam_session_end as  "Auth Completion" aos_deployment_1_openam_session_failed as "Failed Auth"
| table _time  "Auth Start" "Auth Completion"  "Failed Auth"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 03 Jun 2016 14:11:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-optimize-my-search/m-p/280400#M84622</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-06-03T14:11:32Z</dc:date>
    </item>
    <item>
      <title>Re: How do I optimize my search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-optimize-my-search/m-p/280401#M84623</link>
      <description>&lt;P&gt;This one gives me no output other than the _time. Plus it takes longer than before &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jun 2016 15:45:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-optimize-my-search/m-p/280401#M84623</guid>
      <dc:creator>jkalra</dc:creator>
      <dc:date>2016-06-03T15:45:53Z</dc:date>
    </item>
    <item>
      <title>Re: How do I optimize my search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-optimize-my-search/m-p/280402#M84624</link>
      <description>&lt;P&gt;Thanks Somesh.... Unfortunately this takes a lot of time to execute and also there was a correction in timechart count(eventtype).&lt;/P&gt;

&lt;P&gt;Could this because my &lt;STRONG&gt;eventtypes&lt;/STRONG&gt; are not optimized?&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jun 2016 15:48:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-optimize-my-search/m-p/280402#M84624</guid>
      <dc:creator>jkalra</dc:creator>
      <dc:date>2016-06-03T15:48:37Z</dc:date>
    </item>
    <item>
      <title>Re: How do I optimize my search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-optimize-my-search/m-p/280403#M84625</link>
      <description>&lt;P&gt;My bad. The correct timechart command was "timechart count by eventtype".&lt;/P&gt;

&lt;P&gt;My experience with eventtype haven't been great as they always slow my queries. What is your eventtype definition? Some time it's better to create a macro with same definition then eventtype.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jun 2016 15:51:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-optimize-my-search/m-p/280403#M84625</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-06-03T15:51:12Z</dc:date>
    </item>
    <item>
      <title>Re: How do I optimize my search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-optimize-my-search/m-p/280404#M84626</link>
      <description>&lt;P&gt;Thats a nice pointer.....can you provide a link on how to create a macro?. &lt;BR /&gt;
This is what my eventtype  looks like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=cams sourcetype=log4j source=*/aos/aos-audit* deployment_id=1 action="AOS-OPENAM-SESSION" status=START
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Can we convert this to a macro?&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jun 2016 16:03:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-optimize-my-search/m-p/280404#M84626</guid>
      <dc:creator>jkalra</dc:creator>
      <dc:date>2016-06-03T16:03:39Z</dc:date>
    </item>
    <item>
      <title>Re: How do I optimize my search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-optimize-my-search/m-p/280405#M84627</link>
      <description>&lt;P&gt;We surely can. Have a look at this&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.4.1/Knowledge/Definesearchmacros"&gt;http://docs.splunk.com/Documentation/Splunk/6.4.1/Knowledge/Definesearchmacros&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jun 2016 16:05:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-optimize-my-search/m-p/280405#M84627</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-06-03T16:05:48Z</dc:date>
    </item>
    <item>
      <title>Re: How do I optimize my search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-optimize-my-search/m-p/280406#M84628</link>
      <description>&lt;P&gt;I downvoted this post because sorry, but this does not give me the desired result . the output i need is failed auth , auth start &amp;amp; auth completion. your search gives me the total counts&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jun 2016 19:43:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-optimize-my-search/m-p/280406#M84628</guid>
      <dc:creator>jkalra</dc:creator>
      <dc:date>2016-06-03T19:43:22Z</dc:date>
    </item>
  </channel>
</rss>

