<?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: Can you help me figure out why our semi-dynamic lookup is not working? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-figure-out-why-our-semi-dynamic-lookup-is-not/m-p/377058#M110632</link>
    <description>&lt;P&gt;If you add &lt;CODE&gt;format&lt;/CODE&gt; to your subsearch and run it as a search like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|inputlookup bbtable.csv | search "Username" = AVCxxxxxxxxxxx | fields "MAC" | dedup "MAC" | format
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You will see that it is creating something like &lt;CODE&gt;( ( MAC="1:2:3:4:5:6" ) OR ... OR ( MAC="5:6:7:8:9:0" ) )&lt;/CODE&gt; which is probably not what you would like because the fieldname in your &lt;CODE&gt;bluecoat&lt;/CODE&gt; logs is not &lt;CODE&gt;MAC&lt;/CODE&gt; but something else.  So do a &lt;CODE&gt;| rename MAC as &amp;lt;other field name&amp;gt;&lt;/CODE&gt; or use this to do a fieldless search instead:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|inputlookup bbtable.csv | search "Username" = AVCxxxxxxxxxxx | fields "MAC" | dedup "MAC" | format "(" "" "" "" "OR" ")" | rex field=search mode=sed "s/MAC=//g"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 31 Mar 2019 07:53:24 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2019-03-31T07:53:24Z</dc:date>
    <item>
      <title>Can you help me figure out why our semi-dynamic lookup is not working?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-figure-out-why-our-semi-dynamic-lookup-is-not/m-p/377057#M110631</link>
      <description>&lt;P&gt;Hi Splunk Users,&lt;/P&gt;

&lt;P&gt;My main search to find DHCP Discover logs is as below:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=bluecat  (Mac_Address)  "DHCPDISCOVER"
| table _time message_option mac_address
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What I am trying to achieve is I have a dashboard, so when I search the Username, it gives me all sorts of information about the Username.&lt;/P&gt;

&lt;P&gt;My token for the username is $clientip$&lt;/P&gt;

&lt;P&gt;I need to look up the Mac_Address from another separate CSV table called bbtable.csv and in this table, it includes the username and mac_address details.&lt;/P&gt;

&lt;P&gt;When I run the lookup separately as below:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;inputlookup bbtable.csv   | search "Username" = AVCxxxxxxxxxxx  | fields "MAC"   | dedup "MAC"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;it returns the required mac_address value I need.&lt;/P&gt;

&lt;P&gt;When I combine the sub-search with my main search as below it fails with the message "No results found. Try expanding the time range."   &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=bluecat [inputlookup bbtable.csv   | search "Username" = AVCxxxxxxxxxxx  | fields "MAC"   | dedup "MAC"]

| table _time message_option mac_address
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Please help&lt;/P&gt;

&lt;P&gt;Thank you in advance&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:50:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-figure-out-why-our-semi-dynamic-lookup-is-not/m-p/377057#M110631</guid>
      <dc:creator>goken</dc:creator>
      <dc:date>2020-09-29T23:50:50Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me figure out why our semi-dynamic lookup is not working?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-figure-out-why-our-semi-dynamic-lookup-is-not/m-p/377058#M110632</link>
      <description>&lt;P&gt;If you add &lt;CODE&gt;format&lt;/CODE&gt; to your subsearch and run it as a search like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|inputlookup bbtable.csv | search "Username" = AVCxxxxxxxxxxx | fields "MAC" | dedup "MAC" | format
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You will see that it is creating something like &lt;CODE&gt;( ( MAC="1:2:3:4:5:6" ) OR ... OR ( MAC="5:6:7:8:9:0" ) )&lt;/CODE&gt; which is probably not what you would like because the fieldname in your &lt;CODE&gt;bluecoat&lt;/CODE&gt; logs is not &lt;CODE&gt;MAC&lt;/CODE&gt; but something else.  So do a &lt;CODE&gt;| rename MAC as &amp;lt;other field name&amp;gt;&lt;/CODE&gt; or use this to do a fieldless search instead:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|inputlookup bbtable.csv | search "Username" = AVCxxxxxxxxxxx | fields "MAC" | dedup "MAC" | format "(" "" "" "" "OR" ")" | rex field=search mode=sed "s/MAC=//g"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 31 Mar 2019 07:53:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-figure-out-why-our-semi-dynamic-lookup-is-not/m-p/377058#M110632</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-03-31T07:53:24Z</dc:date>
    </item>
  </channel>
</rss>

