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!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...