Great, that worked, thanks.
I just wished that would have been more apparent from the docs. I guessed something like 'tostring' might exist, and tried 'element:toString()' and similar without success. There are three mentionings of 'tostring' on the doc page for Lua filters, two in the section entitled "Global variables" where you would only spot them by chance. And one is in the section about the
LogMessage type where I figured LogMessage objects had a 'tostring' method, but didn't know how to use the LogMessage type in the first place.
T.