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!

Introducing the 2024 SplunkTrust!

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

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...