Splunk Search

How to get the first 20 characters of a field value in Splunk

bhuvanabala
New Member

Hi Team,

  1. I have two fields called Message and Solution. Value of the Solution field is a link which i have defined that in workflow.
  2. on clicking the solution it should get the first 20 characters of the Mesage field value ie. i have defined as http://xxxx:8000/XXX? form.errordesc=$Message$.Substring(0,20) in workflow.
  3. But when i click on solution link i get the message value along with .Substring(0,20) ie. "hello.substring(0,20)" in Dashbaord input field

Please help me how to define substring in workflow URL

Tags (1)
0 Karma
1 Solution

kamlesh_vaghela
SplunkTrust
SplunkTrust

HI @bhuvanabala,

Have you tried to eval new field short_message in props.conf and use it in workflow action URL?

EVAL-ShortMessage= substr(Message,1,20)

Use this eval field in URL:

http://xxxx:8000/XXX? form.errordesc=$ShortMessage$

Thanks

View solution in original post

kamlesh_vaghela
SplunkTrust
SplunkTrust

HI @bhuvanabala,

Have you tried to eval new field short_message in props.conf and use it in workflow action URL?

EVAL-ShortMessage= substr(Message,1,20)

Use this eval field in URL:

http://xxxx:8000/XXX? form.errordesc=$ShortMessage$

Thanks

bhuvanabala
New Member

Thanks it worked for me

0 Karma
Get Updates on the Splunk Community!

Enterprise Security Content Updates (ESCU) - New Releases

In the last month, the Splunk Threat Research Team (STRT) has had 3 releases of new content via the Enterprise ...

Thought Leaders are Validating Your Hard Work and Training Rigor

As a Splunk enthusiast and member of the Splunk Community, you are one of thousands who recognize the value of ...

.conf23 Registration is Now Open!

Time to toss the .conf-etti 🎉 —  .conf23 registration is open!   Join us in Las Vegas July 17-20 for ...