Splunk Search

splunk

vinod_52791
Engager

I have logs like below


Email information for the template:payment_receipt_ppo_1 Posted Successfully with status:200

Email information for the template:DEV_1 Posted Successfully with status:200

Email information for the template:payment_1 Posted Successfully with status:400





i want to display like below


template

----------
payment_receipt_ppo_1
DEV_1
payment_1

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
| rex "template:(?<template>\S+)"
0 Karma

vinod_52791
Engager

If i place the above field i.e "

template:(?<template>\S+)

I am getting below result

payment_receipt_ppo_
DEV_
payment_


so i noticed afer backspace 1 is missing for some logs and for some logs (if the value is dev template) i am getting dev only after space I.e remplate is missing in the result 

Tags (1)
0 Karma

vinod_52791
Engager

i want full value like below

payment_receipt_ppo_1
DEV_1
payment_1

and one more thing space separated string is also not appearing

for example if i hav evalue is log is template:dev value

but i am getting dev only

please suggest any solution




 

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Please show the logs that are not working in a code block (use </> above to insert the code block). This is so that it isn't formatted and potentially removing spaces from what is shown.

0 Karma

vinod_52791
Engager

i didnt understand what you are saying?

 

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

When you paste your log entries, put them in a code sample by clicking on this symbolCapture.PNGso we can see exactly what you have because the rex expression should have worked based on what you had pasted earlier.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...