<?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: How to match a partial string in search in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-match-a-partial-string-in-search/m-p/389818#M113579</link>
    <description>&lt;P&gt;Hi ,&lt;BR /&gt;
I am trying to use like this - &lt;BR /&gt;
| eval access=if(((occurrences&amp;gt;1 OR Request_EMail like "dl-%@%.com" ) AND (Request_CommonName  like "^[^.]+.*.ent.bhpbilliton.net") ) , "Grant" , "Reject") &lt;/P&gt;

&lt;P&gt;But here it goes to access= "Reject"  , how I can use this in eval .&lt;/P&gt;

&lt;P&gt;Thank you &lt;/P&gt;</description>
    <pubDate>Wed, 30 Sep 2020 01:23:46 GMT</pubDate>
    <dc:creator>himanshu_b_shek</dc:creator>
    <dc:date>2020-09-30T01:23:46Z</dc:date>
    <item>
      <title>How to match a partial string in search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-match-a-partial-string-in-search/m-p/389814#M113575</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
I have a field called CommonName, sample value of CommonName  are below: &lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;CommonName  = xyz.apac.ent.bhpbilliton.net&lt;/LI&gt;
&lt;LI&gt;CommonName   =         xyz.ent.bhpbilliton.net&lt;/LI&gt;
&lt;LI&gt;CommonName  = xyz.emea.ent.bhpbilliton.net&lt;/LI&gt;
&lt;LI&gt;CommonName  = xyz.abc.ent.bhpbilliton.net&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;I want to match 2nd value ONLY I am using- CommonName like "%.ent.bhpbilliton.net", it gives all above-listed CommonName.&lt;BR /&gt;
I want to select only 2nd one, Please advice here.&lt;/P&gt;

&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jul 2019 16:24:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-match-a-partial-string-in-search/m-p/389814#M113575</guid>
      <dc:creator>himanshu_b_shek</dc:creator>
      <dc:date>2019-07-16T16:24:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to match a partial string in search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-match-a-partial-string-in-search/m-p/389815#M113576</link>
      <description>&lt;P&gt;The &lt;CODE&gt;%&lt;/CODE&gt; character in the &lt;CODE&gt;match&lt;/CODE&gt; function matches everything.  Since your four sample values all end with the string in your &lt;CODE&gt;match&lt;/CODE&gt; they all match.  To have a more specific matching pattern, you'll need to use a regular expression in the &lt;CODE&gt;like&lt;/CODE&gt; function like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | where like(CommonName, "^[^\.]+\.*\.ent\.bhpbilliton\.net") | ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 16 Jul 2019 16:52:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-match-a-partial-string-in-search/m-p/389815#M113576</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2019-07-16T16:52:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to match a partial string in search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-match-a-partial-string-in-search/m-p/389816#M113577</link>
      <description>&lt;P&gt;You can use your query like this..&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;your index search&amp;gt;| rex field=CommonName "\w+.(?&amp;lt;str&amp;gt;\w+.\w+.\w+)"| where str="ent.bhpbilliton.net"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 16 Jul 2019 17:05:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-match-a-partial-string-in-search/m-p/389816#M113577</guid>
      <dc:creator>Vijeta</dc:creator>
      <dc:date>2019-07-16T17:05:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to match a partial string in search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-match-a-partial-string-in-search/m-p/389817#M113578</link>
      <description>&lt;P&gt;Thank you so much , it worked &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jul 2019 17:34:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-match-a-partial-string-in-search/m-p/389817#M113578</guid>
      <dc:creator>himanshu_b_shek</dc:creator>
      <dc:date>2019-07-16T17:34:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to match a partial string in search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-match-a-partial-string-in-search/m-p/389818#M113579</link>
      <description>&lt;P&gt;Hi ,&lt;BR /&gt;
I am trying to use like this - &lt;BR /&gt;
| eval access=if(((occurrences&amp;gt;1 OR Request_EMail like "dl-%@%.com" ) AND (Request_CommonName  like "^[^.]+.*.ent.bhpbilliton.net") ) , "Grant" , "Reject") &lt;/P&gt;

&lt;P&gt;But here it goes to access= "Reject"  , how I can use this in eval .&lt;/P&gt;

&lt;P&gt;Thank you &lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 01:23:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-match-a-partial-string-in-search/m-p/389818#M113579</guid>
      <dc:creator>himanshu_b_shek</dc:creator>
      <dc:date>2020-09-30T01:23:46Z</dc:date>
    </item>
  </channel>
</rss>

