出现此错误是因为使用count和count_distinct对同一个字段进行聚合时导致的。解决方法是分别对不同的字段进行聚合,或者使用其他聚合函数代替其中一个。示例代码:
原有查询语句:
fields @timestamp, @message | stats count(), count_distinct(@message)
需要修改成:
fields @timestamp, @message | stats count() by @timestamp, count_distinct(@message) by @timestamp