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!

Developer Spotlight with Brett Adams

In our third Spotlight feature, we're excited to shine a light on Brett—a Splunk consultant, innovative ...

Index This | What can you do to make 55,555 equal 500?

April 2025 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with this ...

Say goodbye to manually analyzing phishing and malware threats with Splunk Attack ...

In today’s evolving threat landscape, we understand you’re constantly bombarded with phishing and malware ...