Splunk Search

Capitalize the first character of a string value using eval or field format?

atornes
Path Finder

How can I capitalize the first character of some string values using one of the eval or fieldformat operators?

Tags (3)
1 Solution

Ayn
Legend

Off the top of my head (I have no Splunk instance to try this on at the moment), this should do it:

... | eval myfield = upper(substr(myfield,1,1)).substr(myfield,2)

View solution in original post

Ayn
Legend

Off the top of my head (I have no Splunk instance to try this on at the moment), this should do it:

... | eval myfield = upper(substr(myfield,1,1)).substr(myfield,2)

scentoni_splunk
Splunk Employee
Splunk Employee

Try this

| eval myfield = upper(substr(myfield,1,1)).lower(substr(myfield,2))
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...