Found out that the issue was caused by the Telegraf version running on the server. The expression is running fine with version 1.8 but not with version 1.25. Downgrading to ver. 1.8 solved the issue!