<?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 have the lookup multivalue field return the 1st match? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-have-the-lookup-multivalue-field-return-the-1st-match/m-p/379148#M111109</link>
    <description>&lt;P&gt;thx for response as always... I did have it backwards. the headers in the lookup file should have been Authentication.src,  Authentication.user..&lt;/P&gt;

&lt;P&gt;The thing that was catching me up is the single quotes around the first parameter in the mvindex() function.  As soon as I added the quotes the commands I entered worked. &lt;/P&gt;

&lt;P&gt;Thx again.&lt;/P&gt;</description>
    <pubDate>Tue, 01 May 2018 20:06:03 GMT</pubDate>
    <dc:creator>brdr</dc:creator>
    <dc:date>2018-05-01T20:06:03Z</dc:date>
    <item>
      <title>How to have the lookup multivalue field return the 1st match?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-have-the-lookup-multivalue-field-return-the-1st-match/m-p/379144#M111105</link>
      <description>&lt;P&gt;hello,&lt;/P&gt;

&lt;P&gt;I have a lookup table that has host to user correlation... ex;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Host, User
hosta, user1
hostb, user2
hostb, user3
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;My understanding is that when I match on hostb via lookup below I will get field Authentication.user back as a multivalue field. But when I try to use 'mv' commands to get first user for hostb (user2) I get blank field for top_user. Why? thx.  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults | eval host="hostb"
    | table host
    | lookup host-to-users.csv Authentication.src as host OUTPUT Authentication.user
    | eval top_user=mvindex(Authentication.user,0)
    | table host Authentication.user top_user
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 May 2018 18:33:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-have-the-lookup-multivalue-field-return-the-1st-match/m-p/379144#M111105</guid>
      <dc:creator>brdr</dc:creator>
      <dc:date>2018-05-01T18:33:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to have the lookup multivalue field return the 1st match?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-have-the-lookup-multivalue-field-return-the-1st-match/m-p/379145#M111106</link>
      <description>&lt;P&gt;If your lookup fields are host and user (that exact name), you're using wrong order in your lookup invocation. Do you get any value in Authentication.user right now? &lt;/P&gt;</description>
      <pubDate>Tue, 01 May 2018 18:46:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-have-the-lookup-multivalue-field-return-the-1st-match/m-p/379145#M111106</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-05-01T18:46:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to have the lookup multivalue field return the 1st match?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-have-the-lookup-multivalue-field-return-the-1st-match/m-p/379146#M111107</link>
      <description>&lt;P&gt;Hey somesoni2,  yes I get the appropriate number of user(s) that match on host.  Just not sure why I can't operate on the users mv field to get the first (value) user. &lt;/P&gt;</description>
      <pubDate>Tue, 01 May 2018 18:54:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-have-the-lookup-multivalue-field-return-the-1st-match/m-p/379146#M111107</guid>
      <dc:creator>brdr</dc:creator>
      <dc:date>2018-05-01T18:54:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to have the lookup multivalue field return the 1st match?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-have-the-lookup-multivalue-field-return-the-1st-match/m-p/379147#M111108</link>
      <description>&lt;P&gt;You have a mismatch in field names and wrong ordering to boot, with a dash of possible misinterpretation of &lt;CODE&gt;.&lt;/CODE&gt; as &lt;CODE&gt;concatenation operator&lt;/CODE&gt;.  Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults | eval host="hostb"
| table host
| lookup host-to-users.csv host AS Authentication.src OUTPUT user AS Authentication.user
| eval top_user=mvindex('Authentication.user', 0)
| table host Authentication.user top_user
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 May 2018 19:36:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-have-the-lookup-multivalue-field-return-the-1st-match/m-p/379147#M111108</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2018-05-01T19:36:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to have the lookup multivalue field return the 1st match?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-have-the-lookup-multivalue-field-return-the-1st-match/m-p/379148#M111109</link>
      <description>&lt;P&gt;thx for response as always... I did have it backwards. the headers in the lookup file should have been Authentication.src,  Authentication.user..&lt;/P&gt;

&lt;P&gt;The thing that was catching me up is the single quotes around the first parameter in the mvindex() function.  As soon as I added the quotes the commands I entered worked. &lt;/P&gt;

&lt;P&gt;Thx again.&lt;/P&gt;</description>
      <pubDate>Tue, 01 May 2018 20:06:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-have-the-lookup-multivalue-field-return-the-1st-match/m-p/379148#M111109</guid>
      <dc:creator>brdr</dc:creator>
      <dc:date>2018-05-01T20:06:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to have the lookup multivalue field return the 1st match?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-have-the-lookup-multivalue-field-return-the-1st-match/m-p/379149#M111110</link>
      <description>&lt;P&gt;I hate non-alphanumeric characters in field names, especially &lt;CODE&gt;spaces&lt;/CODE&gt; and &lt;CODE&gt;periods&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 01 May 2018 20:10:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-have-the-lookup-multivalue-field-return-the-1st-match/m-p/379149#M111110</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2018-05-01T20:10:10Z</dc:date>
    </item>
  </channel>
</rss>

