我正在尝试运行以下查询
index=one /thispath/file*.pdf
我知道不建议在字符串中间使用通配符,但我有太多不同的文件:file001.pdf
、fileabc.pdf
等。
我能做什么?我更担心的是虚假结果而不是处理速度。
谢谢!
不推荐,但它有效。 只管去做。
index=one "/thispath/file*.pdf"
我认为您可以根据需要通过 3 种方式之一执行此操作:
| makeresults | eval field="/thispath/fileone.pdf"
告诉Splunk寻找某事的开始和结束
| 搜索字段="/此路径/文件*" 和字段="*.pdf">
使用通配符在事件搜索后进行筛选
| where like(field, "/thispath/file%.pdf"(
使用正则表达式在事件搜索后过滤
| where match(field, "/thispath/file.*.pdf"(