<?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 do i use if/case functions using lookup table search? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-i-use-if-case-functions-using-lookup-table-search/m-p/668681#M229367</link>
    <description>&lt;P&gt;OK, so you don't have any correlation in the lookup to match against the event...&lt;/P&gt;&lt;P&gt;So, If you have a field 'Subject' containing the string&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;"File system alert on ..."&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;then you can get the system name from that like this&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=Subject "File system alert on (?&amp;lt;system&amp;gt;.*)"&lt;/LI-CODE&gt;&lt;P&gt;which will work for AAA and BBB, but I am not sure how you would map 'server serveraaaname' to AAA in your example - what is the rule for that mapping?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 15 Nov 2023 03:41:04 GMT</pubDate>
    <dc:creator>bowesmana</dc:creator>
    <dc:date>2023-11-15T03:41:04Z</dc:date>
    <item>
      <title>How do i use if/case functions using lookup table search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-i-use-if-case-functions-using-lookup-table-search/m-p/668648#M229354</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have a use case where I have a bunch of email alerts that I need to determine the system name for.&lt;/P&gt;&lt;P&gt;Examples,&amp;nbsp;&lt;/P&gt;&lt;P&gt;lets say i have the alerts:&lt;/P&gt;&lt;P&gt;1. File system alert on AAA&lt;/P&gt;&lt;P&gt;2. File system alert on server servernameaaaendservername&lt;/P&gt;&lt;P&gt;3. File system alert on server BBB&lt;/P&gt;&lt;P&gt;I have the list of these system names in a lookup table (Around 100 unique names), so adding 100 lines of &lt;STRONG&gt;&lt;EM&gt;field_name LIKE "%systemname1%","systemname1"&lt;/EM&gt; &lt;/STRONG&gt;doesn't seem efficient. Is there a way to use the conditional statement with the lookup table to match the statments?&lt;/P&gt;&lt;P&gt;Trying to get the below output by using the system names found in the lookup table&lt;/P&gt;&lt;P&gt;&lt;EM&gt;If systemname is found in the lookup table that matches on what is found in the alert, output systemname&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Alert Name || System Name&lt;/P&gt;&lt;P&gt;File system alert on AAA || AAA&lt;/P&gt;&lt;P&gt;File system alert on server servernameaaaendservername || AAA&lt;BR /&gt;File system alert on server BBB || BBB&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2023 21:39:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-i-use-if-case-functions-using-lookup-table-search/m-p/668648#M229354</guid>
      <dc:creator>umithchada</dc:creator>
      <dc:date>2023-11-14T21:39:32Z</dc:date>
    </item>
    <item>
      <title>Re: How do i use if/case functions using lookup table search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-i-use-if-case-functions-using-lookup-table-search/m-p/668666#M229358</link>
      <description>&lt;P&gt;Just use the lookup as a lookup - that's what it's intended for&lt;/P&gt;&lt;P&gt;It's a little unclear what exists in the alert and what exists in the lookup based on this statement&lt;/P&gt;&lt;P&gt;&lt;EM&gt;If systemname is found in the lookup table that matches on what is found in the alert, output systemname&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;so I'm assuming you have an Alert Name in your data, so just so&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| lookup your_lookup_file.csv "Alert Name" OUTPUT "System Name"&lt;/LI-CODE&gt;&lt;P&gt;Assuming those are the names of your fields in the data/lookup (Alert Name) and the name of the field in the lookup is "System Name"&lt;/P&gt;</description>
      <pubDate>Wed, 15 Nov 2023 01:34:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-i-use-if-case-functions-using-lookup-table-search/m-p/668666#M229358</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2023-11-15T01:34:43Z</dc:date>
    </item>
    <item>
      <title>Re: How do i use if/case functions using lookup table search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-i-use-if-case-functions-using-lookup-table-search/m-p/668674#M229364</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;You are correct, the alert name is in the data. It is under a single field called "Subject" in a form of a string.&amp;nbsp;&lt;/P&gt;&lt;P&gt;But the data in the lookup table is like this, with a single&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;field " System_name",example:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;AAA&lt;/P&gt;&lt;P&gt;BBB&lt;/P&gt;&lt;P&gt;CCC&lt;/P&gt;&lt;P&gt;DDD&lt;/P&gt;&lt;P&gt;The main data is has just a single field as well called "Subject" ( each row a string):&lt;/P&gt;&lt;P&gt;File system alert on AAA&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;F&lt;/SPAN&gt;&lt;SPAN&gt;ile system alert on server serveraaana&lt;/SPAN&gt;&lt;SPAN&gt;me&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;File system alert on&amp;nbsp; BBB&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just want the output to be like in 2 fields:&lt;/P&gt;&lt;P&gt;Subject || system_name&lt;/P&gt;&lt;P&gt;Fils system alert on AAA || AAA&lt;/P&gt;&lt;P&gt;File system alert on serveraaaname || AAA&lt;/P&gt;&lt;P&gt;File system alert on BBB || BBB&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hopefully this makes sense.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Nov 2023 02:51:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-i-use-if-case-functions-using-lookup-table-search/m-p/668674#M229364</guid>
      <dc:creator>umithchada</dc:creator>
      <dc:date>2023-11-15T02:51:55Z</dc:date>
    </item>
    <item>
      <title>Re: How do i use if/case functions using lookup table search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-i-use-if-case-functions-using-lookup-table-search/m-p/668681#M229367</link>
      <description>&lt;P&gt;OK, so you don't have any correlation in the lookup to match against the event...&lt;/P&gt;&lt;P&gt;So, If you have a field 'Subject' containing the string&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;"File system alert on ..."&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;then you can get the system name from that like this&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=Subject "File system alert on (?&amp;lt;system&amp;gt;.*)"&lt;/LI-CODE&gt;&lt;P&gt;which will work for AAA and BBB, but I am not sure how you would map 'server serveraaaname' to AAA in your example - what is the rule for that mapping?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Nov 2023 03:41:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-i-use-if-case-functions-using-lookup-table-search/m-p/668681#M229367</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2023-11-15T03:41:04Z</dc:date>
    </item>
    <item>
      <title>Re: How do i use if/case functions using lookup table search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-i-use-if-case-functions-using-lookup-table-search/m-p/668686#M229372</link>
      <description>&lt;P&gt;So I have various alerts which have the system name somehow embedded in any place.&lt;/P&gt;&lt;P&gt;I am looking for a query which says , " if system name is found anywhere in the alert (upper or lower case) it should output the appropriate"system name" in the "system_name" field.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Nov 2023 03:50:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-i-use-if-case-functions-using-lookup-table-search/m-p/668686#M229372</guid>
      <dc:creator>umithchada</dc:creator>
      <dc:date>2023-11-15T03:50:05Z</dc:date>
    </item>
    <item>
      <title>Re: How do i use if/case functions using lookup table search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-i-use-if-case-functions-using-lookup-table-search/m-p/668688#M229374</link>
      <description>&lt;P&gt;If you have logic that can convert serveraaaname to AAA then you can write the SPL to do extract that name and show it as system name. If you want to take any characters between the two words &lt;STRONG&gt;server&lt;/STRONG&gt; and &lt;STRONG&gt;name&lt;/STRONG&gt;, then it's simply&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=blabla "server(?&amp;lt;systemname&amp;gt;.*)name"
| eval systemname = upper(systemname)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Nov 2023 04:05:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-i-use-if-case-functions-using-lookup-table-search/m-p/668688#M229374</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2023-11-15T04:05:14Z</dc:date>
    </item>
  </channel>
</rss>

