<?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 do a lookup based on IF statement? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-do-a-lookup-based-on-IF-statement/m-p/326160#M163366</link>
    <description>&lt;P&gt;I'll use a second field called "Action" (that's a code, and can be multivalue) and get the action description using the lookup.&lt;BR /&gt;
Both S and A actionTypes have similar codes (e.g: A1, A2, A3). That's why I need to separate the lookups.&lt;/P&gt;</description>
    <pubDate>Wed, 24 Jan 2018 16:52:54 GMT</pubDate>
    <dc:creator>guimilare</dc:creator>
    <dc:date>2018-01-24T16:52:54Z</dc:date>
    <item>
      <title>Is it possible to do a lookup based on IF statement?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-do-a-lookup-based-on-IF-statement/m-p/326158#M163364</link>
      <description>&lt;P&gt;Hello Splunkers,&lt;BR /&gt;
here is my scenario:&lt;/P&gt;

&lt;P&gt;I have a field &lt;STRONG&gt;actionType&lt;/STRONG&gt; that can assume two values: "&lt;STRONG&gt;S&lt;/STRONG&gt;" or "&lt;STRONG&gt;A&lt;/STRONG&gt;".&lt;BR /&gt;
Based on &lt;STRONG&gt;actionType&lt;/STRONG&gt; value, I need to do a lookup in different lookup tables.&lt;/P&gt;

&lt;P&gt;For example, if &lt;STRONG&gt;actionType&lt;/STRONG&gt; is "&lt;STRONG&gt;S&lt;/STRONG&gt;", I have to do a lookup with &lt;STRONG&gt;&lt;EM&gt;S_actions.csv&lt;/EM&gt;&lt;/STRONG&gt; table; if it is "&lt;STRONG&gt;A&lt;/STRONG&gt;", I have to do a lookup with &lt;STRONG&gt;&lt;EM&gt;A_actions.csv&lt;/EM&gt;&lt;/STRONG&gt; table.&lt;/P&gt;

&lt;P&gt;My first idea was using an if statement, but I was unable to do so.&lt;BR /&gt;
Any Ideas?&lt;/P&gt;

&lt;P&gt;Thank in advance!&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2018 16:43:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-do-a-lookup-based-on-IF-statement/m-p/326158#M163364</guid>
      <dc:creator>guimilare</dc:creator>
      <dc:date>2018-01-24T16:43:34Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to do a lookup based on IF statement?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-do-a-lookup-based-on-IF-statement/m-p/326159#M163365</link>
      <description>&lt;P&gt;on selection of action type as "S" or "A", what action needs to be performed on lookup?&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2018 16:48:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-do-a-lookup-based-on-IF-statement/m-p/326159#M163365</guid>
      <dc:creator>493669</dc:creator>
      <dc:date>2018-01-24T16:48:30Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to do a lookup based on IF statement?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-do-a-lookup-based-on-IF-statement/m-p/326160#M163366</link>
      <description>&lt;P&gt;I'll use a second field called "Action" (that's a code, and can be multivalue) and get the action description using the lookup.&lt;BR /&gt;
Both S and A actionTypes have similar codes (e.g: A1, A2, A3). That's why I need to separate the lookups.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2018 16:52:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-do-a-lookup-based-on-IF-statement/m-p/326160#M163366</guid>
      <dc:creator>guimilare</dc:creator>
      <dc:date>2018-01-24T16:52:54Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to do a lookup based on IF statement?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-do-a-lookup-based-on-IF-statement/m-p/326161#M163367</link>
      <description>&lt;P&gt;I'd do it like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search 
| eval s_action=if(actionType="S", Action, NULL), a_action=if(actionType="A", Action, NULL
| lookup S_actions.csv action AS s_action
| lookup A_actions.csv action AS a_action
| fields - s_action a_action
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 24 Jan 2018 17:43:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-do-a-lookup-based-on-IF-statement/m-p/326161#M163367</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2018-01-24T17:43:15Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to do a lookup based on IF statement?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-do-a-lookup-based-on-IF-statement/m-p/326162#M163368</link>
      <description>&lt;P&gt;Thanks! Exactly what I needed!&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2018 17:54:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-do-a-lookup-based-on-IF-statement/m-p/326162#M163368</guid>
      <dc:creator>guimilare</dc:creator>
      <dc:date>2018-01-24T17:54:45Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to do a lookup based on IF statement?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-do-a-lookup-based-on-IF-statement/m-p/326163#M163369</link>
      <description>&lt;P&gt;Glad to help. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2018 18:05:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-do-a-lookup-based-on-IF-statement/m-p/326163#M163369</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2018-01-24T18:05:22Z</dc:date>
    </item>
  </channel>
</rss>

