<?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 Intersect not working properly? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Intersect-not-working-properly/m-p/96608#M182530</link>
    <description>&lt;P&gt;Hi all,&lt;BR /&gt;
I have an intersect search which tries to intersect two search queries with a field. This is the command:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(OPER "| IN |" xDSL) OR (OPER STATUS) [| set intersect [search (OPER "| IN |" xDSL) | fields TransactionID | fields - _*] [search (OPER STATUS) | fields TransactionID | fields - _*] ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What this command does is it intersects and displays the logs which contain OPER IN xDSL and OPER STATUS with the transactionID.&lt;/P&gt;

&lt;P&gt;The problem occurs when I want to intersect and display logs which contain OPER IN 1234 and OPER STATUS with the transactionID. Eg:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(OPER "| IN |" 1234) OR (OPER STATUS) [| set intersect [search (OPER "| IN |" 1234) | fields TransactionID | fields - _*] [search (OPER STATUS) | fields TransactionID | fields - _*] ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It seems that when I search for a number (i.e. 1234), the command is not compiled correctly. &lt;/P&gt;

&lt;P&gt;Any advice?&lt;/P&gt;

&lt;P&gt;Thanks in advance&lt;/P&gt;

&lt;P&gt;Simon&lt;/P&gt;</description>
    <pubDate>Thu, 12 Jul 2012 11:38:43 GMT</pubDate>
    <dc:creator>simonattardGO</dc:creator>
    <dc:date>2012-07-12T11:38:43Z</dc:date>
    <item>
      <title>Intersect not working properly?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Intersect-not-working-properly/m-p/96608#M182530</link>
      <description>&lt;P&gt;Hi all,&lt;BR /&gt;
I have an intersect search which tries to intersect two search queries with a field. This is the command:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(OPER "| IN |" xDSL) OR (OPER STATUS) [| set intersect [search (OPER "| IN |" xDSL) | fields TransactionID | fields - _*] [search (OPER STATUS) | fields TransactionID | fields - _*] ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What this command does is it intersects and displays the logs which contain OPER IN xDSL and OPER STATUS with the transactionID.&lt;/P&gt;

&lt;P&gt;The problem occurs when I want to intersect and display logs which contain OPER IN 1234 and OPER STATUS with the transactionID. Eg:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(OPER "| IN |" 1234) OR (OPER STATUS) [| set intersect [search (OPER "| IN |" 1234) | fields TransactionID | fields - _*] [search (OPER STATUS) | fields TransactionID | fields - _*] ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It seems that when I search for a number (i.e. 1234), the command is not compiled correctly. &lt;/P&gt;

&lt;P&gt;Any advice?&lt;/P&gt;

&lt;P&gt;Thanks in advance&lt;/P&gt;

&lt;P&gt;Simon&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jul 2012 11:38:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Intersect-not-working-properly/m-p/96608#M182530</guid>
      <dc:creator>simonattardGO</dc:creator>
      <dc:date>2012-07-12T11:38:43Z</dc:date>
    </item>
    <item>
      <title>Re: Intersect not working properly?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Intersect-not-working-properly/m-p/96609#M182531</link>
      <description>&lt;P&gt;I would do this a different way. Here is the simpliest form:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;oper "| in |" 1234
| join TransactionID
   [search oper status 
    | format maxresults=10000 ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This should work for &lt;CODE&gt;xdsl&lt;/CODE&gt; as well as &lt;CODE&gt;1234&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;If you only want to see the TransactionID in the results, you can add the fields command.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;oper "| in |" 1234
| fields TransactionID
| join TransactionID
   [search oper status 
    | fields TransactionID
    | format maxresults=10000 ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Some additional facts, which you may already know but some readers may not:&lt;/P&gt;

&lt;P&gt;Splunk searches are case-insensitive, so it doesn't matter if you enter oper or OPER.This search is looking for events that have all three of the following tokens, in any order or position, without regard to case:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;oper
| in |
1234
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But Splunk search is based on keywords - so you will find events with the term "oper" but not "operator"&lt;/P&gt;

&lt;P&gt;The search is looking for the vertical bars as well, so it isn't just looking for OPER IN 1234&lt;/P&gt;

&lt;P&gt;HTH&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jul 2012 05:05:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Intersect-not-working-properly/m-p/96609#M182531</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2012-07-16T05:05:57Z</dc:date>
    </item>
    <item>
      <title>Re: Intersect not working properly?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Intersect-not-working-properly/m-p/96610#M182532</link>
      <description>&lt;P&gt;in intersect , it will include the internal as well as raw fields and will match it , it will not match the single field , so for that u have to exclude the internal fields  by    |fields host|fields - _*&lt;/P&gt;</description>
      <pubDate>Mon, 09 Mar 2015 10:56:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Intersect-not-working-properly/m-p/96610#M182532</guid>
      <dc:creator>kartik13</dc:creator>
      <dc:date>2015-03-09T10:56:01Z</dc:date>
    </item>
  </channel>
</rss>

