<?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 check if a field contains a value of another field? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-check-if-a-field-contains-a-value-of-another-field/m-p/247856#M73952</link>
    <description>&lt;P&gt;Even if we append and dedup the results are still different because they are prefixes... the CIDR command can work for only numerical values being an IP address, but for this instance we are using Hex decimals. So at this stage, it is not possible. We tried using the foreach but because we have 30,000 different prefixes... our subsearches were huge and max out.. &lt;/P&gt;</description>
    <pubDate>Mon, 15 Oct 2018 21:50:03 GMT</pubDate>
    <dc:creator>Sp3ctre11</dc:creator>
    <dc:date>2018-10-15T21:50:03Z</dc:date>
    <item>
      <title>How to check if a field contains a value of another field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-check-if-a-field-contains-a-value-of-another-field/m-p/247843#M73939</link>
      <description>&lt;P&gt;I would like to take the value of a field and see if it is CONTAINED within another field (not exact match). The text is not necessarily always in the beginning. Some examples of what I am trying to match:&lt;/P&gt;

&lt;P&gt;Ex: field1=text field2=text@domain &lt;BR /&gt;
Ex2: field1=text field2=sometext&lt;/P&gt;

&lt;P&gt;I'm attempting to search Windows event 4648 for non-matching usernames. We have users with admin accounts that are very close to their unprivileged account names but with a couple characters added.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jul 2016 20:42:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-check-if-a-field-contains-a-value-of-another-field/m-p/247843#M73939</guid>
      <dc:creator>jpolcari</dc:creator>
      <dc:date>2016-07-08T20:42:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if a field contains a value of another field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-check-if-a-field-contains-a-value-of-another-field/m-p/247844#M73940</link>
      <description>&lt;P&gt;You can do something this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your search | eval result=if(like(field2,"%".field1."%"),"Contained","Not Contained")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 08 Jul 2016 20:56:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-check-if-a-field-contains-a-value-of-another-field/m-p/247844#M73940</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-07-08T20:56:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if a field contains a value of another field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-check-if-a-field-contains-a-value-of-another-field/m-p/247845#M73941</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval match=if(match(text,text2),1,0)
| where match=1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;As the match command uses a RegEx, you can match one field as RegEx against another field.&lt;/P&gt;

&lt;P&gt;From eval docs:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;match(SUBJECT, "REGEX")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 08 Jul 2016 21:00:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-check-if-a-field-contains-a-value-of-another-field/m-p/247845#M73941</guid>
      <dc:creator>Raschko</dc:creator>
      <dc:date>2016-07-08T21:00:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if a field contains a value of another field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-check-if-a-field-contains-a-value-of-another-field/m-p/247846#M73942</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| where match(field2,field1)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rename _raw AS raw
| map search="|noop|stats count as contained|eval field2=\"$field2$\" | eval contained=if(like(field2, \"%$field1$%\"), \"$raw$\", null())"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 08 Jul 2016 21:46:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-check-if-a-field-contains-a-value-of-another-field/m-p/247846#M73942</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-07-08T21:46:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if a field contains a value of another field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-check-if-a-field-contains-a-value-of-another-field/m-p/247847#M73943</link>
      <description>&lt;P&gt;thanks very much! I was able to get it working with this.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jul 2016 13:52:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-check-if-a-field-contains-a-value-of-another-field/m-p/247847#M73943</guid>
      <dc:creator>jpolcari</dc:creator>
      <dc:date>2016-07-11T13:52:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if a field contains a value of another field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-check-if-a-field-contains-a-value-of-another-field/m-p/247848#M73944</link>
      <description>&lt;P&gt;I tried to apply this logic as I want to check if the values from con_splunkUL exists within con_UL, but for me it seems its checking for a direct match between both fields rather than checking for a match within the whole data set.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval MonitoringStatus = if(like(con_splunkUL,"%".con_UL."%"), "Monitored", "Not Monitored") 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 17:28:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-check-if-a-field-contains-a-value-of-another-field/m-p/247848#M73944</guid>
      <dc:creator>davidcraven02</dc:creator>
      <dc:date>2020-09-29T17:28:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if a field contains a value of another field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-check-if-a-field-contains-a-value-of-another-field/m-p/247849#M73945</link>
      <description>&lt;P&gt;Did you figure this out, i'm having the same issues &lt;/P&gt;</description>
      <pubDate>Thu, 11 Oct 2018 05:18:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-check-if-a-field-contains-a-value-of-another-field/m-p/247849#M73945</guid>
      <dc:creator>Sp3ctre11</dc:creator>
      <dc:date>2018-10-11T05:18:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if a field contains a value of another field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-check-if-a-field-contains-a-value-of-another-field/m-p/247850#M73946</link>
      <description>&lt;P&gt;Yes I did, I used the below.&lt;/P&gt;

&lt;P&gt;| eval MonitoringStatus = if(like(upper(con_UL),"%".upper(con_splunkUL)."%"), "Monitored", "Not Monitored")&lt;/P&gt;

&lt;P&gt;Also here is another example I used within the same search &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval Action=if ((MonitoringStatus="Not Monitored")AND(like(Path,"%Hosting%")),"Action Required","No Action Required")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 21:32:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-check-if-a-field-contains-a-value-of-another-field/m-p/247850#M73946</guid>
      <dc:creator>davidsplunk123</dc:creator>
      <dc:date>2020-09-29T21:32:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if a field contains a value of another field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-check-if-a-field-contains-a-value-of-another-field/m-p/247851#M73947</link>
      <description>&lt;P&gt;Regarding this though how would you go about it if you have an index  with values...&lt;/P&gt;

&lt;P&gt;and you want to check it against a .csv  which contains prefixes...&lt;/P&gt;

&lt;P&gt;I've currently got a question posted on splunkanswers.  &lt;A href="https://answers.splunk.com/answers/692085/how-to-match-two-columns-based-on-prefix-numbersle.html#answer-692089"&gt;https://answers.splunk.com/answers/692085/how-to-match-two-columns-based-on-prefix-numbersle.html#answer-692089&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Oct 2018 10:50:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-check-if-a-field-contains-a-value-of-another-field/m-p/247851#M73947</guid>
      <dc:creator>Sp3ctre11</dc:creator>
      <dc:date>2018-10-11T10:50:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if a field contains a value of another field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-check-if-a-field-contains-a-value-of-another-field/m-p/247852#M73948</link>
      <description>&lt;P&gt;I have same type of issue there , I want to look into two tables to match fields value if any match found then ignore if no match found then create separate table too display unique values only which comes out of two tables&lt;/P&gt;

&lt;P&gt;Here are my tables, Example: If search pick value (353649273) from table A then it should search for match with  all values in table B , not look like only one value corresponding to that field.&lt;/P&gt;

&lt;P&gt;OrderNumberFailureA    OrderNumberFailureB&lt;BR /&gt;
 353649273                                   353648649&lt;BR /&gt;
 353649184                                   353648566&lt;BR /&gt;
 353649091                                   353616829&lt;BR /&gt;
 353649033                                   353648649&lt;BR /&gt;
 353648797&lt;BR /&gt;&lt;BR /&gt;
 353648680&lt;BR /&gt;&lt;BR /&gt;
 353648745&lt;BR /&gt;&lt;BR /&gt;
 353648730&lt;BR /&gt;&lt;BR /&gt;
 353638941&lt;BR /&gt;&lt;BR /&gt;
 353649331&lt;BR /&gt;&lt;BR /&gt;
 340568517&lt;BR /&gt;&lt;BR /&gt;
 353638941&lt;BR /&gt;&lt;BR /&gt;
 353648361&lt;BR /&gt;&lt;BR /&gt;
 349156251&lt;BR /&gt;&lt;BR /&gt;
 353649335&lt;BR /&gt;&lt;BR /&gt;
 353649091&lt;BR /&gt;&lt;BR /&gt;
 353649240&lt;BR /&gt;&lt;BR /&gt;
 353649143&lt;BR /&gt;&lt;BR /&gt;
 353649160&lt;BR /&gt;&lt;BR /&gt;
 353649092&lt;BR /&gt;&lt;BR /&gt;
 353649312&lt;BR /&gt;&lt;BR /&gt;
 353648984&lt;BR /&gt;&lt;BR /&gt;
 353649091&lt;BR /&gt;&lt;BR /&gt;
 353649163&lt;BR /&gt;&lt;BR /&gt;
 353649240&lt;BR /&gt;&lt;BR /&gt;
 353649092&lt;BR /&gt;&lt;BR /&gt;
 353649143&lt;BR /&gt;&lt;BR /&gt;
 353649095&lt;BR /&gt;&lt;BR /&gt;
 353649008&lt;BR /&gt;&lt;BR /&gt;
 353648984&lt;BR /&gt;&lt;BR /&gt;
 353649008&lt;BR /&gt;&lt;BR /&gt;
 353648794&lt;BR /&gt;&lt;BR /&gt;
 353648856&lt;BR /&gt;&lt;BR /&gt;
 353649273&lt;BR /&gt;&lt;BR /&gt;
 353648796&lt;BR /&gt;&lt;BR /&gt;
 353648754&lt;BR /&gt;&lt;BR /&gt;
 353648620&lt;BR /&gt;&lt;BR /&gt;
 353648594&lt;BR /&gt;&lt;BR /&gt;
 353648794&lt;BR /&gt;&lt;BR /&gt;
 353648649&lt;BR /&gt;&lt;BR /&gt;
 353648685&lt;BR /&gt;&lt;BR /&gt;
 353648651&lt;BR /&gt;&lt;BR /&gt;
 353638941&lt;BR /&gt;&lt;BR /&gt;
 353648610&lt;BR /&gt;&lt;BR /&gt;
 353649273&lt;BR /&gt;&lt;BR /&gt;
 353649241&lt;BR /&gt;&lt;BR /&gt;
 353649163&lt;BR /&gt;&lt;BR /&gt;
 353616829&lt;BR /&gt;&lt;BR /&gt;
 353649163&lt;BR /&gt;&lt;BR /&gt;
 353648754&lt;BR /&gt;&lt;BR /&gt;
 353649347&lt;BR /&gt;&lt;BR /&gt;
 353649335&lt;BR /&gt;&lt;BR /&gt;
 353648748&lt;BR /&gt;&lt;BR /&gt;
 353648661&lt;BR /&gt;&lt;BR /&gt;
 353648649&lt;BR /&gt;&lt;BR /&gt;
 353648754&lt;BR /&gt;&lt;BR /&gt;
 353648649&lt;BR /&gt;&lt;BR /&gt;
 353648649&lt;BR /&gt;&lt;BR /&gt;
 353648984&lt;BR /&gt;&lt;BR /&gt;
 353648994&lt;BR /&gt;&lt;BR /&gt;
 353648802&lt;BR /&gt;&lt;BR /&gt;
 353649263&lt;BR /&gt;&lt;BR /&gt;
 353648649&lt;BR /&gt;&lt;BR /&gt;
 353649347&lt;BR /&gt;&lt;BR /&gt;
 353649240&lt;BR /&gt;&lt;BR /&gt;
 353649178&lt;BR /&gt;&lt;BR /&gt;
 353616829&lt;BR /&gt;&lt;BR /&gt;
 353649092&lt;BR /&gt;&lt;BR /&gt;
 353648984&lt;BR /&gt;&lt;BR /&gt;
 353648754&lt;BR /&gt;&lt;BR /&gt;
 353648768&lt;BR /&gt;&lt;BR /&gt;
 353648749&lt;BR /&gt;&lt;BR /&gt;
 353649387&lt;BR /&gt;&lt;BR /&gt;
 353648680&lt;BR /&gt;&lt;BR /&gt;
 353648649&lt;BR /&gt;&lt;BR /&gt;
 353648566&lt;/P&gt;</description>
      <pubDate>Fri, 12 Oct 2018 12:07:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-check-if-a-field-contains-a-value-of-another-field/m-p/247852#M73948</guid>
      <dc:creator>ashikuma</dc:creator>
      <dc:date>2018-10-12T12:07:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if a field contains a value of another field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-check-if-a-field-contains-a-value-of-another-field/m-p/247853#M73949</link>
      <description>&lt;P&gt;Did anyone get a chance to look into this as well&lt;/P&gt;</description>
      <pubDate>Sat, 13 Oct 2018 11:46:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-check-if-a-field-contains-a-value-of-another-field/m-p/247853#M73949</guid>
      <dc:creator>ashikuma</dc:creator>
      <dc:date>2018-10-13T11:46:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if a field contains a value of another field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-check-if-a-field-contains-a-value-of-another-field/m-p/247854#M73950</link>
      <description>&lt;P&gt;Its complicated, still didnt get this quite working.. &lt;/P&gt;</description>
      <pubDate>Sun, 14 Oct 2018 22:21:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-check-if-a-field-contains-a-value-of-another-field/m-p/247854#M73950</guid>
      <dc:creator>Sp3ctre11</dc:creator>
      <dc:date>2018-10-14T22:21:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if a field contains a value of another field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-check-if-a-field-contains-a-value-of-another-field/m-p/247855#M73951</link>
      <description>&lt;P&gt;I tried using foreach loop but that didn't work. If we think about logic then it says we have to pick value from table A and search for each value in next table(B) which logically should be possible using foreach look to iterate through each value.&lt;/P&gt;

&lt;P&gt;Also if this is not possible then can you query like to get count of unique values by appending column 2 into column 1 then check for count more than 1.&lt;/P&gt;

&lt;P&gt;But in this case we have to dedup column 1 &amp;amp; 2 before we append them to avoid any discrepancy. Waiting for your comments.... &lt;/P&gt;</description>
      <pubDate>Mon, 15 Oct 2018 06:19:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-check-if-a-field-contains-a-value-of-another-field/m-p/247855#M73951</guid>
      <dc:creator>ashikuma</dc:creator>
      <dc:date>2018-10-15T06:19:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if a field contains a value of another field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-check-if-a-field-contains-a-value-of-another-field/m-p/247856#M73952</link>
      <description>&lt;P&gt;Even if we append and dedup the results are still different because they are prefixes... the CIDR command can work for only numerical values being an IP address, but for this instance we are using Hex decimals. So at this stage, it is not possible. We tried using the foreach but because we have 30,000 different prefixes... our subsearches were huge and max out.. &lt;/P&gt;</description>
      <pubDate>Mon, 15 Oct 2018 21:50:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-check-if-a-field-contains-a-value-of-another-field/m-p/247856#M73952</guid>
      <dc:creator>Sp3ctre11</dc:creator>
      <dc:date>2018-10-15T21:50:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if a field contains a value of another field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-check-if-a-field-contains-a-value-of-another-field/m-p/247857#M73953</link>
      <description>&lt;P&gt;can we store both search queries results into two lookup tables instead of creating normal table, after that can we compare for unique values.&lt;/P&gt;

&lt;P&gt;Just a ask&lt;/P&gt;</description>
      <pubDate>Tue, 16 Oct 2018 09:31:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-check-if-a-field-contains-a-value-of-another-field/m-p/247857#M73953</guid>
      <dc:creator>ashikuma</dc:creator>
      <dc:date>2018-10-16T09:31:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if a field contains a value of another field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-check-if-a-field-contains-a-value-of-another-field/m-p/549175#M155799</link>
      <description>&lt;P&gt;I am using this and it works, but how can I have it ignore the case of the compared contained string.&amp;nbsp; Make it case insensitive?&lt;/P&gt;</description>
      <pubDate>Fri, 23 Apr 2021 18:35:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-check-if-a-field-contains-a-value-of-another-field/m-p/549175#M155799</guid>
      <dc:creator>kslemster</dc:creator>
      <dc:date>2021-04-23T18:35:18Z</dc:date>
    </item>
  </channel>
</rss>

