Splunk Search

rtrim trims additional symbols

ArsenyKapralov
Path Finder

Hello

I'm trying to use rtrim to modify dns host name which I receive from domain controller. I'm using following search string:

 | eval HostName=rtrim(HostName,".bankrc.local")

I tested this on hostname "hq-mileshin.bankrc.local" but as a result I receive "hq-mileshi". Can you please help me to fix this and get a proper result: "hq-mileshin"

Tags (2)
1 Solution

somesoni2
Revered Legend

You can use replace function of Splunk for this

e.g.

| gentimes start=-1 | eval HostName="hq-mileshin.bankrc.local"  | replace *.bankrc.local WITH * IN HostName

View solution in original post

somesoni2
Revered Legend

You can use replace function of Splunk for this

e.g.

| gentimes start=-1 | eval HostName="hq-mileshin.bankrc.local"  | replace *.bankrc.local WITH * IN HostName
Get Updates on the Splunk Community!

Upcoming Webinar: Unmasking Insider Threats with Slunk Enterprise Security’s UEBA

Join us on Wed, Dec 10. at 10AM PST / 1PM EST for a live webinar and demo with Splunk experts! Discover how ...

.conf25 technical session recap of Observability for Gen AI: Monitoring LLM ...

If you’re unfamiliar, .conf is Splunk’s premier event where the Splunk community, customers, partners, and ...

A Season of Skills: New Splunk Courses to Light Up Your Learning Journey

There’s something special about this time of year—maybe it’s the glow of the holidays, maybe it’s the ...