Splunk Search

how to remove last character of a field value from the search results

muthvin
New Member

how to remove last character of a field value from the search results

0 Karma
1 Solution

jmallorquin
Builder

Hi,

With rex you can do this

| rex field=yourfield "(?<no_last>.*)."

Hope help you

View solution in original post

0 Karma

jmallorquin
Builder

Hi,

With rex you can do this

| rex field=yourfield "(?<no_last>.*)."

Hope help you

0 Karma

muthvin
New Member

thx for your reply jmallorquin, but i need more clarity on your suggestion .
Also i tried |eval field=rtrim(yourfield,"****") which helped me.

It will be great if you help me in understanding your view mentioned above.

  • Muthu
0 Karma

jmallorquin
Builder

Sure,

With my command i match all the characters less the last one in a new field called no_last

0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...