在elasticsearch中实现了日志记录,在多个字段中实现了搜索。
curl -X GET 1.2.3.4:9200/logs/_search?pretty=true -H 'Content-Type: application/json' -d '{"size":30,"query":{"constant_score":{"filter":{"bool":{"must":[{"terms":{"ident.keyword":["sip"]}}]}}}},"post_filter":{"multi_match":{"query":"9998887722","fields":["message","loglevel","env","site","project","ident"]}},"sort":[{"@timestamp":"desc"}]}'
基本上,搜索是通过电话号码在日志中执行的。电话号码可以以 7、+7、8 开头,或者根本没有前缀。现在搜索是通过完全匹配进行的,因此您需要确切知道将数字以什么格式写入日志。我想输入一个不带前缀的数字并找到它的所有变体,例如+79998887722, 89998887722, 9998887722, 79998887722, A019998887722
是否可以以某种方式更改查询以按后缀搜索数据?
我在文档中没有找到 prefix_len 的反向类似物。

