Getting Data In

How to truncate a field or limit a field value

ethanthomas
Path Finder

I have  a field called org_name in the data as below 

Org_name="davidcareerhome"

Org_name ="Ethanfurniture"

I want to limit the Org_name only for the first three bytes as below 

Org_name="dav"

Org_name="Eth"

Can someone help me with this and how to do make this change in props.conf and the regex for the same ?

Labels (1)

richgalloway
SplunkTrust
SplunkTrust

Use the substr function.

... | eval Org_name=substr(Org_name, 1, 3)

 

---
If this reply helps you, Karma would be appreciated.
Get Updates on the Splunk Community!

Almost Too Eventful Assurance: Part 1

Modern IT and Network teams still struggle with too many alerts and isolating issues before they are notified. ...

Demo Day: Strengthen Your SOC with Splunk Enterprise Security 8.1

Today’s threat landscape is more complex than ever. Security operation centers (SOCs) are overwhelmed with ...

Dashboards: Hiding charts while search is being executed and other uses for tokens

There are a couple of features of SimpleXML / Classic dashboards that can be used to enhance the user ...