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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...