below is my search
I want to trim "-server"
and I tried this
| eval source=trim("abc-server", "-server")
did not work any idea how to do this?
the easiest way is a regex:
| rex field=source "(?<source>[^-]*)-server"
or, if the string before "-server" has a fixed lenght
| eval source=substr(source,1,string_lenght)
but regex is better and more efficient!
thanks cusello and kamlesh, i will try your suggestions.
Can you please try below search?
YOUR_SEARCH | rex field=source "(?<source>.*)\-.*"