I have three fields :
field1 field2 field3
mumbai kolkata andhra
Output should be like :
Please help !!
use an eval to concatenate the fields, and in the case a field is missing, use a sed command to remove the extra separation commas.
mysearch | fillnull value="" field1 field2 field3 | eval myfield=field1.",".field2.",".field3 | rex field=myfield mode=sed "s/([,]*)}/,/g" | table myfield
remark : sed command not tested, please try or replace by some logic in the eval.
Thanks Kristian, the fillnull is required indeed, let me add it.
Thats what one would like to think, but if either of the fields is missing altogether, the eval fails.
You'd have to use fillnull or similar first.