<?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 to show lookup value if not present in subsearch in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-show-lookup-value-if-not-present-in-subsearch/m-p/581422#M202552</link>
    <description>&lt;P&gt;Rather than using join, you could try using append and stats, first to "join" the two index searches, then the "lookup" table&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;``` this makeresults represents the index a search ```
| makeresults
| eval _raw="user action
tom deleted
aaron added"
| multikv forceheader=1
``` rename user field so it matches with field in index b ```
| rename user as id
| append 
``` this makeresults represents the index b search ```
    [| makeresults
    | eval _raw="name,id
Tom Brady,tom
Aaron Rodgers,aaron"
    | multikv forceheader=1 ]
``` remove superfluous fields ```
| fields - _raw _time linecount
``` "join" by id ```
| stats values(*) as * by id
| append 
``` this makeresults represents the inputlookup ```
    [| makeresults
    | eval _raw="name
Tom Brady
Foo Bar
Aaron Rodgers"
    | multikv forceheader=1 ]
``` remove superfluous fields ```
| fields - _raw _time linecount
``` "join" by name ```
| stats values(*) as * by name
``` fill the empty fields ```
| fillnull value="N/A" action id&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 18 Jan 2022 06:18:32 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2022-01-18T06:18:32Z</dc:date>
    <item>
      <title>How to show lookup value if not present in subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-show-lookup-value-if-not-present-in-subsearch/m-p/581419#M202551</link>
      <description>&lt;P&gt;&lt;BR /&gt;Please help!&lt;BR /&gt;I have a lookup table and some data in two different indexes. Please help with a search that will produce an output like the following?&amp;nbsp; I need to show "Foo Bar", which is present in the lookup, but has no values associated with the name in either index.&lt;BR /&gt;&lt;FONT face="courier new,courier" size="3"&gt;name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; id&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; action&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="3"&gt;Tom Brady&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tom&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; deleted&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="3"&gt;Foo Bar&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; N/A&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; N/A&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="3"&gt;Aaron Rodgers&amp;nbsp; aaron&amp;nbsp;&amp;nbsp; added&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;inputlookup=player.csv, column heading is name&lt;BR /&gt;Tom Brady&lt;BR /&gt;Foo Bar&lt;BR /&gt;Aaron Rodgers&lt;/P&gt;&lt;P&gt;index=a&lt;BR /&gt;name="Tom Brady" id=tom&lt;BR /&gt;name="Aaron Rodgers" id=aaron&lt;/P&gt;&lt;P&gt;index=b&lt;BR /&gt;user=tom action=deleted&lt;BR /&gt;user=aaron action=added&lt;/P&gt;&lt;P&gt;This is where I’m stuck. How can I also show "Foo Bar" as N/A ?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=b 
| join type=inner user
   [ | search index=a 
    [| inputlookup player.csv 
    | fields name ]  
| rename id AS user ]
| table name, user, action&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jan 2022 05:32:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-show-lookup-value-if-not-present-in-subsearch/m-p/581419#M202551</guid>
      <dc:creator>hank72</dc:creator>
      <dc:date>2022-01-18T05:32:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to show lookup value if not present in subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-show-lookup-value-if-not-present-in-subsearch/m-p/581422#M202552</link>
      <description>&lt;P&gt;Rather than using join, you could try using append and stats, first to "join" the two index searches, then the "lookup" table&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;``` this makeresults represents the index a search ```
| makeresults
| eval _raw="user action
tom deleted
aaron added"
| multikv forceheader=1
``` rename user field so it matches with field in index b ```
| rename user as id
| append 
``` this makeresults represents the index b search ```
    [| makeresults
    | eval _raw="name,id
Tom Brady,tom
Aaron Rodgers,aaron"
    | multikv forceheader=1 ]
``` remove superfluous fields ```
| fields - _raw _time linecount
``` "join" by id ```
| stats values(*) as * by id
| append 
``` this makeresults represents the inputlookup ```
    [| makeresults
    | eval _raw="name
Tom Brady
Foo Bar
Aaron Rodgers"
    | multikv forceheader=1 ]
``` remove superfluous fields ```
| fields - _raw _time linecount
``` "join" by name ```
| stats values(*) as * by name
``` fill the empty fields ```
| fillnull value="N/A" action id&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jan 2022 06:18:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-show-lookup-value-if-not-present-in-subsearch/m-p/581422#M202552</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-01-18T06:18:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to show lookup value if not present in subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-show-lookup-value-if-not-present-in-subsearch/m-p/581597#M202612</link>
      <description>&lt;P&gt;Thank you very much.&amp;nbsp; Your suggestion and example was of great help to me.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jan 2022 08:29:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-show-lookup-value-if-not-present-in-subsearch/m-p/581597#M202612</guid>
      <dc:creator>hank72</dc:creator>
      <dc:date>2022-01-19T08:29:14Z</dc:date>
    </item>
  </channel>
</rss>

