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!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...