<?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: Matching field values to text in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Matching-field-values-to-text/m-p/576088#M200761</link>
    <description>&lt;P&gt;Alternatively if you want these numbers to be defined in an external lookup, so you can edit the lookup to maintain the hot fix ids, then just make a CSV with a single field 'HotFixID' with the list of IDs you want to match then use this logic&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=oswin EventCode=19 SourceName="Microsoft-Windows-WindowsUpdateClient" earliest=-10d ComputerName=*.somedomain.com
| rex "\WKB(?&amp;lt;KB&amp;gt;.\d+)\W"
| lookup your_list_of_hotfix_ids.csv HotFixID as KB OUTPUIT HotFixID as Found
| eval HotFixID=if(isnull(Found), "Not Installed", KB)&lt;/LI-CODE&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 23 Nov 2021 21:10:05 GMT</pubDate>
    <dc:creator>bowesmana</dc:creator>
    <dc:date>2021-11-23T21:10:05Z</dc:date>
    <item>
      <title>Matching field values to text</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Matching-field-values-to-text/m-p/576080#M200758</link>
      <description>&lt;P&gt;I have a base search:&lt;BR /&gt;index=oswin EventCode=19 SourceName="Microsoft-Windows-WindowsUpdateClient" earliest=-10d ComputerName=*.somedomain.com&lt;BR /&gt;| rex "\WKB(?&amp;lt;KB&amp;gt;.\d+)\W"&lt;/P&gt;&lt;P&gt;The result populates field ‘KB’ with a list of values similar to:&lt;BR /&gt;5007192&lt;BR /&gt;5008601&lt;BR /&gt;890830&lt;/P&gt;&lt;P&gt;I need to test if ‘KB’ contains one of the following:&lt;BR /&gt;“5008601”, “5008602”, “5008603”, “5008604”, “5008605”, “5008606”&lt;/P&gt;&lt;P&gt;If a match is found, populate field HotFixID (new field) with the matched value. If no match is found, populate field HotFixID with “NotInstalled”.&lt;/P&gt;&lt;P&gt;Using search KB IN (5008601,5008602,5008603,5008604,5008605,5008606) results in matched values only. Case function works only if the matched value is the last one evaluated, otherwise it returns "notInstalled" even though a match is present.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Nov 2021 20:14:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Matching-field-values-to-text/m-p/576080#M200758</guid>
      <dc:creator>dsb6</dc:creator>
      <dc:date>2021-11-23T20:14:29Z</dc:date>
    </item>
    <item>
      <title>Re: Matching field values to text</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Matching-field-values-to-text/m-p/576087#M200760</link>
      <description>&lt;P&gt;Use the if(in(a,b)) style as this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval KB=split("5007192,5008601,890830", ",")
| mvexpand KB
| eval HotFixID=if(in(KB, 5008601,5008602,5008603,5008604,5008605,5008606), KB, "Not Installed")&lt;/LI-CODE&gt;&lt;P&gt;Last line is what you want&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Nov 2021 21:05:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Matching-field-values-to-text/m-p/576087#M200760</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2021-11-23T21:05:12Z</dc:date>
    </item>
    <item>
      <title>Re: Matching field values to text</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Matching-field-values-to-text/m-p/576088#M200761</link>
      <description>&lt;P&gt;Alternatively if you want these numbers to be defined in an external lookup, so you can edit the lookup to maintain the hot fix ids, then just make a CSV with a single field 'HotFixID' with the list of IDs you want to match then use this logic&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=oswin EventCode=19 SourceName="Microsoft-Windows-WindowsUpdateClient" earliest=-10d ComputerName=*.somedomain.com
| rex "\WKB(?&amp;lt;KB&amp;gt;.\d+)\W"
| lookup your_list_of_hotfix_ids.csv HotFixID as KB OUTPUIT HotFixID as Found
| eval HotFixID=if(isnull(Found), "Not Installed", KB)&lt;/LI-CODE&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Nov 2021 21:10:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Matching-field-values-to-text/m-p/576088#M200761</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2021-11-23T21:10:05Z</dc:date>
    </item>
    <item>
      <title>Re: Matching field values to text</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Matching-field-values-to-text/m-p/576098#M200766</link>
      <description>&lt;P&gt;The suggested if(in(a,b)) does return the required results however, the results include a HotFixID value for each KB value.&amp;nbsp;Using the sample KB values from my post, results for HotFixID are&lt;/P&gt;&lt;P&gt;NotInstalled&lt;BR /&gt;5008601&lt;BR /&gt;NotInstalled&lt;/P&gt;&lt;P&gt;Preference would be to have one result per ComputerName with HotFixID value of matched KB value or NotInstalled.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Nov 2021 21:52:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Matching-field-values-to-text/m-p/576098#M200766</guid>
      <dc:creator>dsb6</dc:creator>
      <dc:date>2021-11-23T21:52:38Z</dc:date>
    </item>
    <item>
      <title>Re: Matching field values to text</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Matching-field-values-to-text/m-p/576267#M200847</link>
      <description>&lt;P&gt;Not sure I understand - the example search shows&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="bowesmana_0-1637797190119.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/17001i15FD6C087EE12537/image-size/medium?v=v2&amp;amp;px=400" role="button" title="bowesmana_0-1637797190119.png" alt="bowesmana_0-1637797190119.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Are you getting something different?&lt;/P&gt;</description>
      <pubDate>Wed, 24 Nov 2021 23:41:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Matching-field-values-to-text/m-p/576267#M200847</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2021-11-24T23:41:20Z</dc:date>
    </item>
    <item>
      <title>Re: Matching field values to text</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Matching-field-values-to-text/m-p/577709#M201325</link>
      <description>&lt;P&gt;Thanks for your reply bowesmana. I was not clear on the desired output.&lt;/P&gt;&lt;P&gt;EventCode=19 will return multiple results for hundreds of ComputerName matches. The desired output is one line per ComputerName where HotFixID is either the matched KB or 'NotInstalled'.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Dec 2021 22:05:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Matching-field-values-to-text/m-p/577709#M201325</guid>
      <dc:creator>dsb6</dc:creator>
      <dc:date>2021-12-07T22:05:44Z</dc:date>
    </item>
    <item>
      <title>Re: Matching field values to text</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Matching-field-values-to-text/m-p/577723#M201331</link>
      <description>&lt;P&gt;The two solutions I mentioned earlier - do neither of those give you what you want. If not, what is wrong with them.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Dec 2021 01:43:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Matching-field-values-to-text/m-p/577723#M201331</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2021-12-08T01:43:57Z</dc:date>
    </item>
  </channel>
</rss>

