Hi,
I'm trying to do a sed (replacing comma with _) on all fields, instead of having to specify which field I want to do the sed command on. Is that possible?
I tried to do field=*, but that did not work.
Thanks.
Alternatively you could use foreach:
| foreach * [eval <<FIELD>>=replace(<<FIELD>>, ",", "_" )]
If you like, you can take it to props.conf.
We do the following to remove spaces -
# :" kkkki " -- remove spaces
SEDCMD-trim-ws1 = s/(:\")(\s+)?(\w+)(\s+)?(\")/\1\3\5/g
So, it's a sed command at the props.conf level.
In your case, the following should work -
SEDCMD-replace = s/,/_/g
Alternatively you could use foreach:
| foreach * [eval <<FIELD>>=replace(<<FIELD>>, ",", "_" )]
This works! Thanks a lot!
Try field=_raw OR you don't need to specify a field. You could just do rex mode=sed "your regex"
I tried this but it didn't work.