Trying to a SED like search and replace?
[SOLVED] Hello, I have a few events which contain a raw field with multiple [
]'s. I'd like to replace all occurances with " ". I tried in a Eval function: _raw=_raw.replace(/[
]+/, " "). This works for the first occurance, but not the others. I also tried with replaceAll, but that just crossed out the entire field. Is there a simple way to just do a SED like search and replace?
Answers
-
The Mask function is what I'd look at
0 -
Hi, thank you. I just tried Mask, but I don't see a way to make it match all instances for the carriage return. It again just replaces the first.
0 -
In the Regex field, there are flags on the right side
0 -
Enable the g flag for global
0 -
ah very nice thank you. This works perfectly for literal strings. But when I put [
] there the output goes completely white
0 -
with global set
0 -
without global the first instance is replaced sucessfully
0 -
That is strange and shouldn't happen...
0 -
just to be sure I copied the raw event in notepad++ to verify the carriage returns; they're there. hmm
0 -
oh I know the problem
0 -
Try replacing it with € instead of space
0 -
Just to see how many it spits out
0 -
one should remove the filter with which one identtifeid the multiple carriage retunrs with the filter gone, it works perfectly! thanks again
0 -
Oh lol
0 -
You mean there were zero events
0 -
I assumed only _raw was empty afterwards
0 -
yup all good now! thanks again!
0