<?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: Conditional Lookup in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Conditional-Lookup/m-p/302528#M91051</link>
    <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your currrent search giving fields instance, a field for each check_ids and profile
| eval temp=instance."#".profile | fields - instance profile
| untable temp Check_ID Val
| eval Profile=mvindex(split(temp,"#"),1)
| lookup YourLookupTable.csv Check_ID Profile OUTPUT Profile as Val2
| eval Val2=if(isnull(Val2),"Unknown",null())
| eval Val=coalesce(Val,Val2)
| xyseries temp Check_ID Val
| rex field=temp "(?&amp;lt;instance&amp;gt;.+)#(?&amp;lt;profile&amp;gt;.+)" | fields - temp
| table instance * profile
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 11 Jan 2018 19:44:14 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2018-01-11T19:44:14Z</dc:date>
    <item>
      <title>Conditional Lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Conditional-Lookup/m-p/302526#M91049</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;

&lt;P&gt;This appears to be a complex scenario to me to implement on Splunk&lt;/P&gt;

&lt;P&gt;Below is the table i have on Splunk&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/4132i09096A0B19F14500/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;In the above table, for check_ids (1.1.10, 1.1.14.... and so on ) there are multiple blank fields and i need to fill the blanks with a information in the lookup and condition.&lt;/P&gt;

&lt;P&gt;Below is the lookup file.&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/4133i09AA00901732169C/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;In the lookup file, for each profile what all check_id are present is mentioned.&lt;/P&gt;

&lt;P&gt;Here comes the problem statement.&lt;/P&gt;

&lt;P&gt;In the first image above i want to fill the blanks to "unknown" if for that respective profile and check_id there is no entry in the lookup table. &lt;/P&gt;

&lt;P&gt;For example - In the first row, the profile is "coreos-level-1" and there is blank for "&lt;STRONG&gt;1.1.10&lt;/STRONG&gt;", "&lt;STRONG&gt;1.1.14&lt;/STRONG&gt;", both these entries are not there in the lookup, so i want to replace blank with "Unknown", whereas if the check_id exists in the lookup then nothing needs to be filled and it can remain blank.&lt;/P&gt;

&lt;P&gt;Can anyone help me with a logic to get this done in Splunk?&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jan 2018 19:25:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Conditional-Lookup/m-p/302526#M91049</guid>
      <dc:creator>ashish9433</dc:creator>
      <dc:date>2018-01-11T19:25:13Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Conditional-Lookup/m-p/302527#M91050</link>
      <description>&lt;P&gt;How was the top table created?  Being in that format definitely complicates your search, so if you instead have access to the data used to create that table it may be easier to start with the raw data instead.&lt;/P&gt;

&lt;P&gt;Also, please include these samples in text form, not screenshots.  It's very difficult to work with sample data when you have to manually enter it in.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jan 2018 19:39:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Conditional-Lookup/m-p/302527#M91050</guid>
      <dc:creator>micahkemp</dc:creator>
      <dc:date>2018-01-11T19:39:52Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Conditional-Lookup/m-p/302528#M91051</link>
      <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your currrent search giving fields instance, a field for each check_ids and profile
| eval temp=instance."#".profile | fields - instance profile
| untable temp Check_ID Val
| eval Profile=mvindex(split(temp,"#"),1)
| lookup YourLookupTable.csv Check_ID Profile OUTPUT Profile as Val2
| eval Val2=if(isnull(Val2),"Unknown",null())
| eval Val=coalesce(Val,Val2)
| xyseries temp Check_ID Val
| rex field=temp "(?&amp;lt;instance&amp;gt;.+)#(?&amp;lt;profile&amp;gt;.+)" | fields - temp
| table instance * profile
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 11 Jan 2018 19:44:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Conditional-Lookup/m-p/302528#M91051</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-01-11T19:44:14Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Conditional-Lookup/m-p/302529#M91052</link>
      <description>&lt;P&gt;This guidance, made me get what i was looking for! Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jan 2018 16:03:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Conditional-Lookup/m-p/302529#M91052</guid>
      <dc:creator>ashish9433</dc:creator>
      <dc:date>2018-01-12T16:03:57Z</dc:date>
    </item>
  </channel>
</rss>

