<?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 can we optimize our current search? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-we-optimize-our-current-search/m-p/213642#M62676</link>
    <description>&lt;P&gt;Hi anantdeshpande,&lt;BR /&gt;
in your question there is a visualization problem of the regex, you have to format your search as Code.&lt;BR /&gt;
Every way, you can build your search in this way:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index= idx_prod sourcetype=SRC1 OR  sourcetype=SRC2  OR sourcetype=SRC3 OR  sourcetype=SRC4 OR (sourcetype=SRC5 "$TXN_ID$") OR (sourcetype=SRC6 "$TXN_ID$")
| rex "regex1" | rex "regex2" | rex "regex3" | rex "regex4" 
| search TXN_ID = "$TXN_ID$" 
| ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
    <pubDate>Wed, 04 Jan 2017 12:09:12 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2017-01-04T12:09:12Z</dc:date>
    <item>
      <title>How can we optimize our current search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-we-optimize-our-current-search/m-p/213641#M62675</link>
      <description>&lt;P&gt;We want to optimize below query as it's taking 4 Min to execute.  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index= idx_prod  sourcetype=SRC1 "Sent message:" | rex "Sent message: \w\d+\s+\d(?.\d{6}\s+"] | rex "Sent Mgs:\w\d+\s+\d+\s+\d+{4}(?.[A-Z 0-9]{14})" | search TXN_ID = "$TXN_ID$" 
| join type=outer AIREF_ID [search index= idx_prod  sourcetype= SRC2 "Airef Number" | rex "Airef Number\s+\w\d+(?&amp;lt; AIREF_ID &amp;gt;.\d{6}\s+\s" ] 
| join type=outer AIREF_ID [search index = idx_prod sourcetype =SRC3 " Airef Number " | rex "Airef Number\s+\w\d+(?&amp;lt; AIREF_ID &amp;gt;.\d{6}\s+\s" ] 
| join type=outer AIREF_ID [search index= idx_prod sourcetype = SRC4 “orig mq Content" |rex mq Content\s+\=\s+\w\d+(?&amp;lt; AIREF_ID &amp;gt;.\d{6})ACK” ]
|append [search index= idx_prod  sourcetype=SRC5 "$TXN_ID$" ] 
|append [search index= idx_prod  sourcetype=SRC6 "$TXN_ID$" ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Query works as below:&lt;BR /&gt;
1) This query is part of drill-down dashboard. TRAN_ID is passed as token on this dashboard. &lt;BR /&gt;
2) First query: Extracts AIREF_ID &amp;amp; TRAN_ID. This is the only event where we both ID are present.[search TXN_ID = "$TXN_ID$"] searches for the event where TRAN_ID matches.&lt;BR /&gt;
3) Join queries: Extracts AIREF_ID and joins with 1st query. &lt;BR /&gt;
4) Append queries: Searches events for having TXN_ID and appends with 1st query.   &lt;/P&gt;

&lt;P&gt;How we want to optimize the search:&lt;BR /&gt;
1) Want to avoid joins.&lt;BR /&gt;
2) How can we extract &amp;amp; pass AIREF_ID as token in the same dashboard. Something like Run 1st query in the background, extract AIREF_ID &amp;amp; pass it as token in the panel.&lt;BR /&gt;
3) Does sub-search instead of join will improve performance?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 12:15:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-we-optimize-our-current-search/m-p/213641#M62675</guid>
      <dc:creator>anantdeshpande</dc:creator>
      <dc:date>2020-09-29T12:15:14Z</dc:date>
    </item>
    <item>
      <title>Re: How can we optimize our current search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-we-optimize-our-current-search/m-p/213642#M62676</link>
      <description>&lt;P&gt;Hi anantdeshpande,&lt;BR /&gt;
in your question there is a visualization problem of the regex, you have to format your search as Code.&lt;BR /&gt;
Every way, you can build your search in this way:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index= idx_prod sourcetype=SRC1 OR  sourcetype=SRC2  OR sourcetype=SRC3 OR  sourcetype=SRC4 OR (sourcetype=SRC5 "$TXN_ID$") OR (sourcetype=SRC6 "$TXN_ID$")
| rex "regex1" | rex "regex2" | rex "regex3" | rex "regex4" 
| search TXN_ID = "$TXN_ID$" 
| ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jan 2017 12:09:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-we-optimize-our-current-search/m-p/213642#M62676</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-01-04T12:09:12Z</dc:date>
    </item>
  </channel>
</rss>

