All Apps and Add-ons

My lookup isn't retrieving the data properly. Did I miss something?

yoshilog
Explorer

I have data that used to be in an if condition, the nameFromChannel is taken from slack, and they use the names as a sort of mechanism to filter the members that are allowed to be a part of the channel. 

The group credentials are then taken from all the members usernames and are assessed individually whether they're allowed to be a member of the group. 

It goes something like this.

 

 

| eval clientName=if(like(nameFromChannel,"%B%"),groupCredentials+ " " +"BASSI",groupCredentials)
| eval clientName=if(like(nameFromChannel,"%W%"),groupCredentials+ " " +"HI WALDORFI",groupCredentials)
| eval clientName=if(like(nameFromChannel,"%V%"),groupCredentials+ " " +"VDWI",groupCredentials)
...

 

 

(So a channel that has xxx_BW_xxx in their name, means that employees with BASSI / HI / WALDORFI attached to their display names are allowed to be members). P.S. we cut the nameFromChannel before hand, so that the only data are the letters.
After some time, we decided that we wanted to change this to a lookup, that had a csv that looked like this :

 

 

nameFromChannel, groupCredentials
%B%, BASSI
%W%, BASSI WALDORFI
%V%, VDWI

 

 

I found a few responses in the below page.

It was a lot of help when setting up the lookup, however, I noticed that the % symbols are not being recognized even after I added the WILDCARD(nameFromChannel) in the advanced options section of my lookup definition, so I changed them to *.

 

| lookup listOfCompaniesDefinition nameFromChannel OUTPUT groupCredentials
| eval clientName=if(groupCredentials="",clientName,clientName+groupCredentials)

 

After testing above, it seems that it isn't evaluating the text properly, my result isn't being displayed the same way it used to. The channels are no longer being retrieved.

Fairly new to splunk, so I would like to hear your feedback. Thank you!

0 Karma
1 Solution

manjunathmeti
Champion

hi @yoshilog.,

Field groupCredentials can be a multivalue field. You need to combine multi values before attaching them to the clientName values.

| lookup listOfCompaniesDefinition nameFromChannel OUTPUT groupCredentials
| mvcombine groupCredentials 
| eval clientName=if(groupCredentials="", clientName, clientName + " " + groupCredentials)

  

If this reply helps you, an upvote/like would be appreciated.

View solution in original post

manjunathmeti
Champion

hi @yoshilog.,

Field groupCredentials can be a multivalue field. You need to combine multi values before attaching them to the clientName values.

| lookup listOfCompaniesDefinition nameFromChannel OUTPUT groupCredentials
| mvcombine groupCredentials 
| eval clientName=if(groupCredentials="", clientName, clientName + " " + groupCredentials)

  

If this reply helps you, an upvote/like would be appreciated.

yoshilog
Explorer

Thanks for your help. It worked!

0 Karma
Get Updates on the Splunk Community!

CX Day is Coming!

Customer Experience (CX) Day is on October 7th!! We're so excited to bring back another day full of wonderful ...

Strengthen Your Future: A Look Back at Splunk 10 Innovations and .conf25 Highlights!

The Big One: Splunk 10 is Here!  The moment many of you have been waiting for has arrived! We are thrilled to ...

Now Offering the AI Assistant Usage Dashboard in Cloud Monitoring Console

Today, we’re excited to announce the release of a brand new AI assistant usage dashboard in Cloud Monitoring ...