<?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: Comparing matching fields in macro in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Comparing-matching-fields-in-macro/m-p/432539#M123592</link>
    <description>&lt;P&gt;I think,you need to try subsearch in this case:&lt;BR /&gt;
like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=windows NOT `macro1` | search NOT [ search index=windows "failed" | where src_user=user]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=windows NOT macro1 | search NOT [`macro2` ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;MACRO2:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; search index=windows "failed" | where src_user=user
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 30 Jan 2019 08:31:37 GMT</pubDate>
    <dc:creator>vishaltaneja070</dc:creator>
    <dc:date>2019-01-30T08:31:37Z</dc:date>
    <item>
      <title>Comparing matching fields in macro</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-matching-fields-in-macro/m-p/432533#M123586</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I would like to display results if both user and src_user field is match but it shows an "unbalanced parentheses" error.&lt;/P&gt;

&lt;P&gt;Main search:&lt;BR /&gt;
index=windows ...... NOT (&lt;CODE&gt;same_login_macro&lt;/CODE&gt;)&lt;BR /&gt;
| table src_user, user&lt;/P&gt;

&lt;P&gt;Macro for &lt;CODE&gt;same_login_macro&lt;/CODE&gt;:&lt;BR /&gt;
"&lt;EM&gt;failed&lt;/EM&gt;" | where src_user=user&lt;/P&gt;

&lt;P&gt;Can someone help - how to return search result when value of both field matched using "where" or other workable method for us in macro?&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jan 2019 04:40:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-matching-fields-in-macro/m-p/432533#M123586</guid>
      <dc:creator>SplunkNewbie18</dc:creator>
      <dc:date>2019-01-30T04:40:58Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing matching fields in macro</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-matching-fields-in-macro/m-p/432534#M123587</link>
      <description>&lt;P&gt;Hello @SplunkNewbie18&lt;/P&gt;

&lt;P&gt;Try this: index=windows ...... NOT &lt;CODE&gt;same_login_macro&lt;/CODE&gt;&lt;BR /&gt;
| table src_user, user&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jan 2019 06:24:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-matching-fields-in-macro/m-p/432534#M123587</guid>
      <dc:creator>vishaltaneja070</dc:creator>
      <dc:date>2019-01-30T06:24:24Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing matching fields in macro</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-matching-fields-in-macro/m-p/432535#M123588</link>
      <description>&lt;P&gt;Hmm...nope it doesnt work. Returns me 0 result. &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; im using the macros as whitelisting concept to exclude events from the results.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jan 2019 07:51:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-matching-fields-in-macro/m-p/432535#M123588</guid>
      <dc:creator>SplunkNewbie18</dc:creator>
      <dc:date>2019-01-30T07:51:39Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing matching fields in macro</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-matching-fields-in-macro/m-p/432536#M123589</link>
      <description>&lt;P&gt;As per the macro definition, this will be the search&lt;BR /&gt;
index=windows ...... NOT "failed" | where src_user=user&lt;BR /&gt;
| table src_user, user&lt;/P&gt;

&lt;P&gt;This will be search which is running in background. could you please let me the exact requirement. What is required as the above search is " Searching for events in windows index, then filter the events which is not having "failed" keyword and the searching for events where sec_user = user"&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:00:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-matching-fields-in-macro/m-p/432536#M123589</guid>
      <dc:creator>vishaltaneja070</dc:creator>
      <dc:date>2020-09-29T23:00:41Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing matching fields in macro</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-matching-fields-in-macro/m-p/432537#M123590</link>
      <description>&lt;P&gt;can u explain in depth what do u want&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jan 2019 08:09:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-matching-fields-in-macro/m-p/432537#M123590</guid>
      <dc:creator>harishalipaka</dc:creator>
      <dc:date>2019-01-30T08:09:50Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing matching fields in macro</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-matching-fields-in-macro/m-p/432538#M123591</link>
      <description>&lt;P&gt;I have mutiple macros in the main search but simplyfying it for illustartion purposes. For instance:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Main search&lt;/STRONG&gt;&lt;BR /&gt;
index=windows NOT &lt;CODE&gt;macro1&lt;/CODE&gt; NOT &lt;CODE&gt;macro2&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Macro 1&lt;/STRONG&gt;&lt;BR /&gt;
"success" user="admin"&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Macro 2&lt;/STRONG&gt;&lt;BR /&gt;
"failed" | where src_user=user&lt;/P&gt;

&lt;P&gt;If you suggest to put NOT &lt;CODE&gt;macro2&lt;/CODE&gt; it will not work as they will perform the NOT condition  and then followed by where -&amp;gt; (NOT "failed") | where src_user=user.  Whereas what im looking for is NOT the results found in ("failed" | where src_user=user).&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:59:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-matching-fields-in-macro/m-p/432538#M123591</guid>
      <dc:creator>SplunkNewbie18</dc:creator>
      <dc:date>2020-09-29T22:59:06Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing matching fields in macro</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-matching-fields-in-macro/m-p/432539#M123592</link>
      <description>&lt;P&gt;I think,you need to try subsearch in this case:&lt;BR /&gt;
like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=windows NOT `macro1` | search NOT [ search index=windows "failed" | where src_user=user]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=windows NOT macro1 | search NOT [`macro2` ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;MACRO2:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; search index=windows "failed" | where src_user=user
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 30 Jan 2019 08:31:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-matching-fields-in-macro/m-p/432539#M123592</guid>
      <dc:creator>vishaltaneja070</dc:creator>
      <dc:date>2019-01-30T08:31:37Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing matching fields in macro</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-matching-fields-in-macro/m-p/432540#M123593</link>
      <description>&lt;P&gt;Ohhh great! It workss. Thanks vishal!&lt;/P&gt;</description>
      <pubDate>Thu, 31 Jan 2019 05:56:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-matching-fields-in-macro/m-p/432540#M123593</guid>
      <dc:creator>SplunkNewbie18</dc:creator>
      <dc:date>2019-01-31T05:56:21Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing matching fields in macro</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-matching-fields-in-macro/m-p/432541#M123594</link>
      <description>&lt;P&gt;@SplunkNewbie18 &lt;/P&gt;

&lt;P&gt;No Problem &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
Can you please accept the answer to close the thread.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Jan 2019 06:26:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-matching-fields-in-macro/m-p/432541#M123594</guid>
      <dc:creator>vishaltaneja070</dc:creator>
      <dc:date>2019-01-31T06:26:49Z</dc:date>
    </item>
  </channel>
</rss>

