<?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: Eval Substring Match? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Eval-Substring-Match/m-p/567508#M197780</link>
    <description>&lt;P&gt;Use match not like&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval field1="http://www.yahoo.com/mail/inbox"
| eval field2="yahoo"
| eval field3="linkedin.com/company/google/profile"
| eval field4="google"
| eval comparison1 = if(match(field1, field2), "1", "0")
| eval comparison2 = if(match(field3, field4), "1", "0")
| eval comparison3 = if(match(field1, field4), "1", "0")
| eval comparison4 = if(match(field3, field2), "1", "0")&lt;/LI-CODE&gt;</description>
    <pubDate>Sat, 18 Sep 2021 09:59:36 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2021-09-18T09:59:36Z</dc:date>
    <item>
      <title>Eval Substring Match?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eval-Substring-Match/m-p/567494#M197771</link>
      <description>&lt;P&gt;Anyone have a good method for doing substring matches where field1 is my searched field and field2 is my substring I want to search for? Attempted to use the following logic without any luck and running low on ideas.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval comparison = if(like(field1, %field2%), "1", "0")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;field1 is a URL and field2 is a base domain, but field2 is input from a lookup, so it's variable but would look something like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;field1="http://www.yahoo.com/mail/inbox"
field2="yahoo"

OR

field1="linkedin.com/company/google/profile"
field2="google"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm low on ideas after spending my time in docs and forums all day.&lt;/P&gt;</description>
      <pubDate>Sat, 18 Sep 2021 00:44:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eval-Substring-Match/m-p/567494#M197771</guid>
      <dc:creator>wilcomply</dc:creator>
      <dc:date>2021-09-18T00:44:01Z</dc:date>
    </item>
    <item>
      <title>Re: Eval Substring Match?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eval-Substring-Match/m-p/567508#M197780</link>
      <description>&lt;P&gt;Use match not like&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval field1="http://www.yahoo.com/mail/inbox"
| eval field2="yahoo"
| eval field3="linkedin.com/company/google/profile"
| eval field4="google"
| eval comparison1 = if(match(field1, field2), "1", "0")
| eval comparison2 = if(match(field3, field4), "1", "0")
| eval comparison3 = if(match(field1, field4), "1", "0")
| eval comparison4 = if(match(field3, field2), "1", "0")&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 18 Sep 2021 09:59:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eval-Substring-Match/m-p/567508#M197780</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-09-18T09:59:36Z</dc:date>
    </item>
    <item>
      <title>Re: Eval Substring Match?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eval-Substring-Match/m-p/567528#M197787</link>
      <description>&lt;P&gt;You might also concatenate values with wildcards (could be useful in case of more complicated patterns)&lt;/P&gt;&lt;PRE&gt;| eval result=if(like(field1, "%".field2."%"),1,0)&lt;/PRE&gt;</description>
      <pubDate>Sat, 18 Sep 2021 19:46:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eval-Substring-Match/m-p/567528#M197787</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2021-09-18T19:46:31Z</dc:date>
    </item>
  </channel>
</rss>

