I have a lookup table that has host to user correlation... ex;
Host, User hosta, user1 hostb, user2 hostb, user3
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.
| 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
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?
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.
You have a mismatch in field names and wrong ordering to boot, with a dash of possible misinterpretation of
concatenation operator. Try this:
| 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
thx for response as always... I did have it backwards. the headers in the lookup file should have been Authentication.src, Authentication.user..
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.