0

我在 splunk 中有以下两种不同源类​​型的数据

索引=“xyz”源类型=“资产”

name
--------
SERVER01
SERVER02
SERVER03

索引=“xyz”源类型=“计算机”

name
--------
SERVER02
SERVER03
SERVER05

我正在尝试获取两种源类型都不匹配的数据

 name
 --------
 SERVER01
 SERVER05

我尝试使用如下所述的外连接进行数据选择,但似乎它不起作用

index="xyz" sourcetype="assets"
| table name
| join type=outer name
   [| search index="xyz" sourcetype="computers"
    | table name]
| table name

请建议

4

1 回答 1

2

stats 命令可以做到这一点。从每个源类型收集服务器并计算它们的数量。计数为 1 的不匹配。

index=xyz (sourcetype=assets OR sourcetype=computers)
| stats count by name
| where count = 1
| table name
于 2020-08-08T15:58:22.237 回答