Splunk Search

3rd Token handler doesn't work with 1st and 2nd token handler together?

wangkevin1029
Communicator

Hi, Splunkers,

I have the following token handler,   if input "Gucid_token_with3handlers" is 2 digits number, it will return as token skillexpressionLength, 

if it's not 2 digits number will return itself as token Gucid_token, which works fine.

now I want to add handler 3,  if 1st 3 characters are VQ_,   I want it to return itself as token Gucid_token_VQ, otherwise, it return as Gucid_token_VQ  with value *

but it looks handler 3 is conflicting with handler 1.

so my question is how to define the 3rd token handler to have it work together 1st and 2nd token handlers without conflict? 

 

the following is the input token definition with 3 token handlers.

<input type="text" token="Gucid_token_with3handlers" searchWhenChanged="true">
<label>Gucid/UUID/SID</label>
<change>
<eval token="Gucid_token"> if(match(value, "^[0-9][0-9]?$"),"", value)</eval>
<eval token="skillexpressionLength">if(match(value, "^[0-9][0-9]?$"),value, 0)</eval>
<eval token="Gucid_token_VQ">if(substr(value,1,3)=="VQ_"),value, *)</eval>
</change>
<default></default>
</input>

 

then I used the following search  clause with  $Gucid_token_VQ$

| search VQ = $Gucid_token_VQ$

 

then this search panel showing :   search is waiting for input.

 

thx in advance.

 

Kevin

Labels (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

You had an extra closing bracket and you need to put the * in quotes

<eval token="Gucid_token_VQ">if(substr(value,1,3)=="VQ_",value, "*")</eval>

View solution in original post

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

You had an extra closing bracket and you need to put the * in quotes

<eval token="Gucid_token_VQ">if(substr(value,1,3)=="VQ_",value, "*")</eval>
0 Karma

wangkevin1029
Communicator

thank you very much , ITWhisperer,

your whisper always works great.

 

Kevin

0 Karma
Get Updates on the Splunk Community!

Now Available: Cisco Talos Threat Intelligence Integrations for Splunk Security Cloud ...

At .conf24, we shared that we were in the process of integrating Cisco Talos threat intelligence into Splunk ...

Preparing your Splunk Environment for OpenSSL3

The Splunk platform will transition to OpenSSL version 3 in a future release. Actions are required to prepare ...

Easily Improve Agent Saturation with the Splunk Add-on for OpenTelemetry Collector

Agent Saturation What and Whys In application performance monitoring, saturation is defined as the total load ...