<?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 Clarification on the search using OR in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Clarification-on-the-search-using-OR/m-p/169377#M48389</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;There are logs coming from two sources (xxx.success, yyy.error) into one index.Fields are to be extracted from the events of these three sources. The information to be extracted are specific to each of the files. But one search query has to be framed for success and error events from the respective files. There are no overlapping information/values between two files. However search query should not be two queries rather one. &lt;/P&gt;

&lt;P&gt;xxx.success :&lt;/P&gt;

&lt;P&gt;&lt;A href="SW:HandlefileTransfer"&gt;SW:HandlefileTransfer&lt;/A&gt;&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
&lt;A href="https://answers.splunk.comSW:HandlefileTransfer"&gt;/SW:HandlefileTransfer&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;yyy.error : &lt;/P&gt;

&lt;P&gt;.&lt;BR /&gt;
&lt;A href="SW:GblStatus"&gt;SW:GblStatus&lt;/A&gt;&lt;BR /&gt;
                .&lt;BR /&gt;
                .&lt;BR /&gt;
                .&lt;A href="SW:Text"&gt;SW:Text&lt;/A&gt;Error occurred....&lt;A href="https://answers.splunk.comSW:Text"&gt;/SW:Text&lt;/A&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;            .
           &amp;lt;SW:GblStatus&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;.&lt;BR /&gt;
.&lt;/P&gt;

&lt;P&gt;Solution 1:&lt;/P&gt;

&lt;P&gt;We framed the search query like&lt;/P&gt;

&lt;P&gt;index =fxr |source = "xxx.success" OR source = "yyy.error" |(Extraction of fields using rex command)&lt;/P&gt;

&lt;P&gt;If the search is to be performed this way, to get successful events the query will unnecessarily search in error events and to get error events the query will unnecessarily search in successful events thereby doing two unnecessary searches taking more time. &lt;/P&gt;

&lt;P&gt;Can you tell an alternative way or suggest some other way to handle this scenario?&lt;/P&gt;

&lt;P&gt;Solution 2:&lt;/P&gt;

&lt;P&gt;Transformation of the logs after combining the logs from two sources into a single file and adding additional tag to the events so as to differentiate the sources from each other like&lt;/P&gt;

&lt;P&gt;&lt;SUCCESS&gt;&lt;BR /&gt;
                &lt;A href="SW:HandlefileTransfer"&gt;SW:HandlefileTransfer&lt;/A&gt;&lt;BR /&gt;
                .&lt;BR /&gt;
                .&lt;BR /&gt;
                .&lt;BR /&gt;
                ..&lt;BR /&gt;
                &lt;A href="https://answers.splunk.comSW:HandlefileTransfer"&gt;/SW:HandlefileTransfer&lt;/A&gt;&lt;BR /&gt;
&lt;/SUCCESS&gt;&lt;BR /&gt;
&lt;ERROR&gt;&lt;BR /&gt;
                &lt;A href="SW:GblStatus"&gt;SW:GblStatus&lt;/A&gt;&lt;BR /&gt;
                .&lt;BR /&gt;
                .&lt;BR /&gt;
                .&lt;A href="SW:Text"&gt;SW:Text&lt;/A&gt;Error occurred....&lt;A href="https://answers.splunk.comSW:Text"&gt;/SW:Text&lt;/A&gt;&lt;/ERROR&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;            .
           &amp;lt;SW:GblStatus&amp;gt;
            &amp;lt;/Error&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;As extra tag is added around the incoming data, we can eliminate the unnecessary search (as mentioned above) and thus reducing the time. Please advise.&lt;/P&gt;</description>
    <pubDate>Mon, 19 May 2014 07:58:53 GMT</pubDate>
    <dc:creator>Jananee_iNautix</dc:creator>
    <dc:date>2014-05-19T07:58:53Z</dc:date>
    <item>
      <title>Clarification on the search using OR</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Clarification-on-the-search-using-OR/m-p/169377#M48389</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;There are logs coming from two sources (xxx.success, yyy.error) into one index.Fields are to be extracted from the events of these three sources. The information to be extracted are specific to each of the files. But one search query has to be framed for success and error events from the respective files. There are no overlapping information/values between two files. However search query should not be two queries rather one. &lt;/P&gt;

&lt;P&gt;xxx.success :&lt;/P&gt;

&lt;P&gt;&lt;A href="SW:HandlefileTransfer"&gt;SW:HandlefileTransfer&lt;/A&gt;&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
&lt;A href="https://answers.splunk.comSW:HandlefileTransfer"&gt;/SW:HandlefileTransfer&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;yyy.error : &lt;/P&gt;

&lt;P&gt;.&lt;BR /&gt;
&lt;A href="SW:GblStatus"&gt;SW:GblStatus&lt;/A&gt;&lt;BR /&gt;
                .&lt;BR /&gt;
                .&lt;BR /&gt;
                .&lt;A href="SW:Text"&gt;SW:Text&lt;/A&gt;Error occurred....&lt;A href="https://answers.splunk.comSW:Text"&gt;/SW:Text&lt;/A&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;            .
           &amp;lt;SW:GblStatus&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;.&lt;BR /&gt;
.&lt;/P&gt;

&lt;P&gt;Solution 1:&lt;/P&gt;

&lt;P&gt;We framed the search query like&lt;/P&gt;

&lt;P&gt;index =fxr |source = "xxx.success" OR source = "yyy.error" |(Extraction of fields using rex command)&lt;/P&gt;

&lt;P&gt;If the search is to be performed this way, to get successful events the query will unnecessarily search in error events and to get error events the query will unnecessarily search in successful events thereby doing two unnecessary searches taking more time. &lt;/P&gt;

&lt;P&gt;Can you tell an alternative way or suggest some other way to handle this scenario?&lt;/P&gt;

&lt;P&gt;Solution 2:&lt;/P&gt;

&lt;P&gt;Transformation of the logs after combining the logs from two sources into a single file and adding additional tag to the events so as to differentiate the sources from each other like&lt;/P&gt;

&lt;P&gt;&lt;SUCCESS&gt;&lt;BR /&gt;
                &lt;A href="SW:HandlefileTransfer"&gt;SW:HandlefileTransfer&lt;/A&gt;&lt;BR /&gt;
                .&lt;BR /&gt;
                .&lt;BR /&gt;
                .&lt;BR /&gt;
                ..&lt;BR /&gt;
                &lt;A href="https://answers.splunk.comSW:HandlefileTransfer"&gt;/SW:HandlefileTransfer&lt;/A&gt;&lt;BR /&gt;
&lt;/SUCCESS&gt;&lt;BR /&gt;
&lt;ERROR&gt;&lt;BR /&gt;
                &lt;A href="SW:GblStatus"&gt;SW:GblStatus&lt;/A&gt;&lt;BR /&gt;
                .&lt;BR /&gt;
                .&lt;BR /&gt;
                .&lt;A href="SW:Text"&gt;SW:Text&lt;/A&gt;Error occurred....&lt;A href="https://answers.splunk.comSW:Text"&gt;/SW:Text&lt;/A&gt;&lt;/ERROR&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;            .
           &amp;lt;SW:GblStatus&amp;gt;
            &amp;lt;/Error&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;As extra tag is added around the incoming data, we can eliminate the unnecessary search (as mentioned above) and thus reducing the time. Please advise.&lt;/P&gt;</description>
      <pubDate>Mon, 19 May 2014 07:58:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Clarification-on-the-search-using-OR/m-p/169377#M48389</guid>
      <dc:creator>Jananee_iNautix</dc:creator>
      <dc:date>2014-05-19T07:58:53Z</dc:date>
    </item>
    <item>
      <title>Re: Clarification on the search using OR</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Clarification-on-the-search-using-OR/m-p/169378#M48390</link>
      <description>&lt;P&gt;First of all your first search is incorrect, but I'm assuming it's pseudo-code?&lt;/P&gt;

&lt;P&gt;Could you please explain what you mean by that it's performing "unnecessary" searches? If you want to find events from xxx.success and yyy.error there's obviously no way around that you'd have to search xxx.success and yyy.error for that. Where does the "unnecessary" part come in?&lt;/P&gt;

&lt;P&gt;If you mean that it's somehow more resource-consuming to search for two different sources instead of just one, that isn't the case. With HUGE numbers of search terms this can be the case but we're talking about thousands of search terms before you might be seeing a performance impact.&lt;/P&gt;</description>
      <pubDate>Mon, 19 May 2014 08:16:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Clarification-on-the-search-using-OR/m-p/169378#M48390</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2014-05-19T08:16:46Z</dc:date>
    </item>
  </channel>
</rss>

