<?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: Compare fields without wildcards in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Compare-fields-without-wildcards/m-p/672763#M230394</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Hi,&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/263242"&gt;@dtburrows3&lt;/a&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I'm still having trouble understanding this query. My goal is to retrieve the file_path field in the event and compare it with a lookup file containing files that should not be deleted. If the file_path in my event matches a file in the lookup file, then the alert should be triggered. Similar to blacklisting malicious IP addresses.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 27 Dec 2023 16:00:57 GMT</pubDate>
    <dc:creator>quangnm21</dc:creator>
    <dc:date>2023-12-27T16:00:57Z</dc:date>
    <item>
      <title>Compare fields without wildcards</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-fields-without-wildcards/m-p/672754#M230390</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hello everyone, I'm a beginner in using Splunk. I'm facing an issue in finding a search solution for the following idea: I'm logging the deletion behavior of files, and I have whitelisted some important files in a lookup. If the file_path in the event matches any of the file_paths in my lookup file, then it should produce a result.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="quangnm21_0-1703690865476.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/28663i8660E651F058DE17/image-size/medium?v=v2&amp;amp;px=400" role="button" title="quangnm21_0-1703690865476.png" alt="quangnm21_0-1703690865476.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Here is the initial search, and it found 2 file_paths.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="quangnm21_1-1703690928479.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/28664i451AB74BCEA2C00B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="quangnm21_1-1703690928479.png" alt="quangnm21_1-1703690928479.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This is my lookup file.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="quangnm21_2-1703690965454.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/28665i69A557349B2F29DC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="quangnm21_2-1703690965454.png" alt="quangnm21_2-1703690965454.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Here is my search, but it's not working correctly.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you, everyone, for reading!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Dec 2023 15:31:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-fields-without-wildcards/m-p/672754#M230390</guid>
      <dc:creator>quangnm21</dc:creator>
      <dc:date>2023-12-27T15:31:01Z</dc:date>
    </item>
    <item>
      <title>Re: Compare fields without wildcards</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-fields-without-wildcards/m-p/672759#M230393</link>
      <description>&lt;P&gt;You should be able to set up "Match Type" configuration under advanced settings when defining a lookup definition for your CSV.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dtburrows3_0-1703692114980.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/28666i1D0FE1555A73D4F8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dtburrows3_0-1703692114980.png" alt="dtburrows3_0-1703692114980.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Example of its usage on my local instance&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dtburrows3_1-1703692160205.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/28667iEBC124086B7A8B78/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dtburrows3_1-1703692160205.png" alt="dtburrows3_1-1703692160205.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;SPL used to simulate (you would need to insert your file_paths in the evals to test this)&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
    | eval
        file_path="/opt/splunk/etc/apps/custom_app/metadata/local.meta"
    | append
        [
            | makeresults
                | eval
                    file_path="/opt/splunk/etc/apps/custom_app/metadata/default.meta"
            ]
    
    | lookup file_deleted file_path OUTPUT file_path as deleted_path
    
    ```
    | where isnotnull(deleted_path)
    ```&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 27 Dec 2023 15:50:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-fields-without-wildcards/m-p/672759#M230393</guid>
      <dc:creator>dtburrows3</dc:creator>
      <dc:date>2023-12-27T15:50:56Z</dc:date>
    </item>
    <item>
      <title>Re: Compare fields without wildcards</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-fields-without-wildcards/m-p/672763#M230394</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi,&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/263242"&gt;@dtburrows3&lt;/a&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I'm still having trouble understanding this query. My goal is to retrieve the file_path field in the event and compare it with a lookup file containing files that should not be deleted. If the file_path in my event matches a file in the lookup file, then the alert should be triggered. Similar to blacklisting malicious IP addresses.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Dec 2023 16:00:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-fields-without-wildcards/m-p/672763#M230394</guid>
      <dc:creator>quangnm21</dc:creator>
      <dc:date>2023-12-27T16:00:57Z</dc:date>
    </item>
    <item>
      <title>Re: Compare fields without wildcards</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-fields-without-wildcards/m-p/672764#M230395</link>
      <description>&lt;P&gt;So to use your original SPL you posted, it would look something like this.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| from datamodel Endpoint.Filesystem | search action=deleted AND Image IN ("*powershell.exe", "*cmd.exe")
| lookup files_deleted file_path OUTPUT file_path as path_lookup
| where isnotnull(path_lookup)&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;This method assumes that the field "file_path" is properly extracted from your events and that you have enabled the match_type WILDCARD(file_path) setting in the lookup definition.&lt;BR /&gt;&lt;BR /&gt;If the field value from "file_path" in the events matches any entry in the lookup, including wildcards, it will return a net-new field to your event named "path_lookup". If an event does not match an entry in the lookup then there will be no new field returned for that event.&lt;BR /&gt;&lt;BR /&gt;The final where clause in the search will only keep the events&amp;nbsp; where a match was made against the lookup.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Dec 2023 16:09:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-fields-without-wildcards/m-p/672764#M230395</guid>
      <dc:creator>dtburrows3</dc:creator>
      <dc:date>2023-12-27T16:09:39Z</dc:date>
    </item>
    <item>
      <title>Re: Compare fields without wildcards</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-fields-without-wildcards/m-p/672765#M230396</link>
      <description>&lt;P&gt;&lt;SPAN&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/263242"&gt;@dtburrows3&lt;/a&gt;&amp;nbsp;,Thank you very much; the knowledge is truly helpful.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Dec 2023 16:21:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-fields-without-wildcards/m-p/672765#M230396</guid>
      <dc:creator>quangnm21</dc:creator>
      <dc:date>2023-12-27T16:21:45Z</dc:date>
    </item>
  </channel>
</rss>

