<?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 Remove record from Query1 if present in Query2 in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Remove-record-from-Query1-if-present-in-Query2/m-p/592669#M206295</link>
    <description>&lt;P&gt;I have 2 Splunk Queries&amp;nbsp;&lt;/P&gt;&lt;P&gt;First Query will return the Employee ID of the Active and Retired Employees.&lt;/P&gt;&lt;P&gt;Second Query will return the Employee ID of the retired Employees.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to merge both the queries to get the result of only the Active employees.&amp;nbsp;&lt;/P&gt;&lt;P&gt;by removing the Retired_Employee_ID from the list of&amp;nbsp;Employee_Id&lt;/P&gt;&lt;P&gt;Query1)&lt;/P&gt;&lt;P&gt;index=employee_data |&lt;FONT color="#008000"&gt;&lt;EM&gt; rex field=_raw&amp;nbsp;&amp;lt;regular expression used to extract Employee_ID&amp;gt;offset_field=_extracted_fields_bounds&lt;/EM&gt;&lt;/FONT&gt; | table Employee_Id&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Query2)&lt;/P&gt;&lt;P&gt;index=employee_data |&lt;EM&gt;&lt;FONT color="#008000"&gt; rex field=_raw&amp;nbsp;&amp;lt;regular expression used to extract Retired_Employee_ID&amp;gt;offset_field=_extracted_fields_bounds&lt;/FONT&gt; &lt;/EM&gt;| table Retired_Employee_ID&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 06 Apr 2022 14:00:45 GMT</pubDate>
    <dc:creator>ngautam760</dc:creator>
    <dc:date>2022-04-06T14:00:45Z</dc:date>
    <item>
      <title>Remove record from Query1 if present in Query2</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Remove-record-from-Query1-if-present-in-Query2/m-p/592669#M206295</link>
      <description>&lt;P&gt;I have 2 Splunk Queries&amp;nbsp;&lt;/P&gt;&lt;P&gt;First Query will return the Employee ID of the Active and Retired Employees.&lt;/P&gt;&lt;P&gt;Second Query will return the Employee ID of the retired Employees.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to merge both the queries to get the result of only the Active employees.&amp;nbsp;&lt;/P&gt;&lt;P&gt;by removing the Retired_Employee_ID from the list of&amp;nbsp;Employee_Id&lt;/P&gt;&lt;P&gt;Query1)&lt;/P&gt;&lt;P&gt;index=employee_data |&lt;FONT color="#008000"&gt;&lt;EM&gt; rex field=_raw&amp;nbsp;&amp;lt;regular expression used to extract Employee_ID&amp;gt;offset_field=_extracted_fields_bounds&lt;/EM&gt;&lt;/FONT&gt; | table Employee_Id&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Query2)&lt;/P&gt;&lt;P&gt;index=employee_data |&lt;EM&gt;&lt;FONT color="#008000"&gt; rex field=_raw&amp;nbsp;&amp;lt;regular expression used to extract Retired_Employee_ID&amp;gt;offset_field=_extracted_fields_bounds&lt;/FONT&gt; &lt;/EM&gt;| table Retired_Employee_ID&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2022 14:00:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Remove-record-from-Query1-if-present-in-Query2/m-p/592669#M206295</guid>
      <dc:creator>ngautam760</dc:creator>
      <dc:date>2022-04-06T14:00:45Z</dc:date>
    </item>
    <item>
      <title>Re: Remove record from Query1 if present in Query2</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Remove-record-from-Query1-if-present-in-Query2/m-p/592670#M206296</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/237054"&gt;@ngautam760&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;please try soimething like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=employee_data Employee_ID="*" NOT Retired_Employee_ID="*" 
| table Retired_Employee_ID&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2022 12:29:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Remove-record-from-Query1-if-present-in-Query2/m-p/592670#M206296</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-04-06T12:29:23Z</dc:date>
    </item>
    <item>
      <title>Re: Remove record from Query1 if present in Query2</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Remove-record-from-Query1-if-present-in-Query2/m-p/592675#M206301</link>
      <description>&lt;P&gt;I think Giuseppe meant&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=employee_data Employee_ID="*" NOT Retired_Employee_ID="*" 
| table Employee_ID&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 06 Apr 2022 12:49:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Remove-record-from-Query1-if-present-in-Query2/m-p/592675#M206301</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-04-06T12:49:37Z</dc:date>
    </item>
    <item>
      <title>Re: Remove record from Query1 if present in Query2</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Remove-record-from-Query1-if-present-in-Query2/m-p/592676#M206302</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/237054"&gt;@ngautam760&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;if you do't have the fields&amp;nbsp;Employee_ID and Retired_Employee_ID, you have two choices:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;create a permanent field extraction using your regexes, so you'll have both the fields and you can use my regex,&lt;/LI&gt;&lt;LI&gt;insert the filters on the fields after the rex extraction, something like this:&lt;/LI&gt;&lt;/UL&gt;&lt;LI-CODE lang="markup"&gt;index=employee_data 
| rex "Employee_ID_extraction"
| rex "Retired_Employee_ID"
| search Employee_ID="*" NOT Retired_Employee_ID="*" 
| table Retired_Employee_ID&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2022 12:50:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Remove-record-from-Query1-if-present-in-Query2/m-p/592676#M206302</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-04-06T12:50:03Z</dc:date>
    </item>
  </channel>
</rss>

