<?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: Is it possible to call lookup within case statement? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-call-lookup-within-case-statement/m-p/680380#M232546</link>
    <description>&lt;P&gt;Since all the lookups appear to be the same, why not do the lookup first, then evaluate (with your conditions) whether the results are worth keeping?&lt;/P&gt;</description>
    <pubDate>Tue, 12 Mar 2024 10:37:07 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2024-03-12T10:37:07Z</dc:date>
    <item>
      <title>Is it possible to call lookup within case statement?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-call-lookup-within-case-statement/m-p/680370#M232540</link>
      <description>&lt;P&gt;I want to call&amp;nbsp;lookup within case statement. if possible, please share sample query.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2024 09:05:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-call-lookup-within-case-statement/m-p/680370#M232540</guid>
      <dc:creator>RSS_STT</dc:creator>
      <dc:date>2024-03-12T09:05:12Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to call lookup within case statement?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-call-lookup-within-case-statement/m-p/680371#M232541</link>
      <description>&lt;P&gt;The simple answer is no - what is your usecase? what are you trying to achieve? There may be another way&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2024 09:10:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-call-lookup-within-case-statement/m-p/680371#M232541</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-03-12T09:10:31Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to call lookup within case statement?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-call-lookup-within-case-statement/m-p/680372#M232542</link>
      <description>&lt;P&gt;Yes you can using the lookup eval command&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/SplunkCloud/9.1.2312/SearchReference/ConditionalFunctions#lookup.28.26lt.3Blookup_table.26gt.3B.2C.26lt.3Bjson_object.26gt.3B.2C.26lt.3Bjson_array.26gt.3B.29" target="_blank"&gt;https://docs.splunk.com/Documentation/SplunkCloud/9.1.2312/SearchReference/ConditionalFunctions#lookup.28.26lt.3Blookup_table.26gt.3B.2C.26lt.3Bjson_object.26gt.3B.2C.26lt.3Bjson_array.26gt.3B.29&lt;/A&gt;&lt;/P&gt;&lt;P&gt;It has to come from a CSV, you cannot use KV store lookups&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2024 09:15:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-call-lookup-within-case-statement/m-p/680372#M232542</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2024-03-12T09:15:48Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to call lookup within case statement?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-call-lookup-within-case-statement/m-p/680375#M232543</link>
      <description>&lt;P&gt;Good point - not easy to use in a case statement though&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2024 09:28:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-call-lookup-within-case-statement/m-p/680375#M232543</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-03-12T09:28:37Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to call lookup within case statement?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-call-lookup-within-case-statement/m-p/680377#M232544</link>
      <description>&lt;P&gt;I have fields aa, bb, cc, dd, hostname and sometime few filed value may be null in payload.&lt;/P&gt;&lt;P&gt;What i want to do.&lt;/P&gt;&lt;P&gt;if (aa, bb is not null) than lookup abc.csv name output name hostname ip&lt;/P&gt;&lt;P&gt;if (cc, dd is not null)&amp;nbsp; than lookup abc.csv name output name hostname ip&lt;/P&gt;&lt;P&gt;if&amp;nbsp;hostname=echo&amp;nbsp;than lookup abc.csv name output name hostname ip&lt;/P&gt;&lt;P&gt;Here is the catch, if 1st if condition is executed it should ignore 2nd &amp;amp; 3rd.&lt;/P&gt;&lt;P&gt;if 2nd if statement&amp;nbsp;executed than 3rd&amp;nbsp;should ignored. Like wise i have to go upto 10 if condition.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2024 09:39:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-call-lookup-within-case-statement/m-p/680377#M232544</guid>
      <dc:creator>RSS_STT</dc:creator>
      <dc:date>2024-03-12T09:39:47Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to call lookup within case statement?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-call-lookup-within-case-statement/m-p/680380#M232546</link>
      <description>&lt;P&gt;Since all the lookups appear to be the same, why not do the lookup first, then evaluate (with your conditions) whether the results are worth keeping?&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2024 10:37:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-call-lookup-within-case-statement/m-p/680380#M232546</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-03-12T10:37:07Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to call lookup within case statement?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-call-lookup-within-case-statement/m-p/680456#M232574</link>
      <description>&lt;P&gt;True enough - it's fiddly and requires post processing of the JSON output, but it's one of the rare conditional if/execute pieces of powerful logic in SPL&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2024 00:09:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-call-lookup-within-case-statement/m-p/680456#M232574</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2024-03-13T00:09:56Z</dc:date>
    </item>
  </channel>
</rss>

