此查询与type,sub_type或missing_fields不匹配。我可以在不使用洞察正则表达式语法的情况下使此查询正常运行,但是我想知道如何弄乱正则表达式语法
我在Cloudwatch见解查询中有一条日志行,看起来像
Extra keys detected in record for schema type "type" and sub_type "sub_type". Error: extra keys not allowed @ data['a_key'],extra keys not allowed @ data['another_key'],
我正在尝试使用
filter @message like /Extra keys detected/
| parse @message /Extra keys detected in record for schema type \"\[(?<type>\S+)\"\] and sub_type \"\[(?<sub_type>\S+)\"\]. Error: (extra keys not allowed @ data\[(?<missing_fields>.*)\])*,/
这可能缺少任意数量的键。
此查询未捕获type和sub_type,这实际上是我解决此问题所需的全部。字段名称的分组是非常不错的奖励,因为这意味着我不需要进行任何第二遍处理。