Getting Data In

SEDCMD trouble- How to delete vfwew from field account?

bosseres
Contributor

Hello everyone!

I'm trying to make props file which will trim all not cyrillic symbols from field "account"

My log example is 

18:10:24 Object="some object" Source="some source1323" Account="Аккаунтvfweцw"

i want to delete vfwew from field Account, but note that symbols can go in any order and with cyrillic symbols too, i need to catch them all and delete, only from one field

SEDCMD-notcyr - Account="....

 

Labels (3)
0 Karma

PickleRick
SplunkTrust
SplunkTrust

There is no way to do it with just a SEDCMD. The y command would match character class anywhere in the event and with s command you can't either restrict matching to a specific field (there is no notion of fields at this point at all) or match (for substitution) a string with holes in it.

Gr0und_Z3r0
Contributor

hi @bosseres 

Try something like this...

Gr0und_Z3r0_0-1680419020003.png

 

| makeresults 
| eval Account="Аккаунтvfweцw"
| rex field=Account mode=sed "s/[^А-Яа-я]+//g"
| table Account


~ If the reply helps, a Karma upvote would be appreciated

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, ...