Getting Data In

異なるsourcetypeから同じ名前のfieldをかけあわせる方法について

appleman
Contributor

異なるソースタイプ[sourcteype=A][sourcetype=B]の中に、それぞれ[field=zzz]という同じ名前のフィールドがあります。
これをサーチで1つにかけあわせて検索する方法で[join]というものを使って下記の通りに検索したところ、"No result"となりました。もし何か、異なるソースタイプで共通するフィールドを一つにまとめて検索する方法がございましたら、ご教授下さい。

sourcetype=A host=* | table xxx yyy | join zzz [ search sourcetype=B | table zzz ] | table xxx yyy zzz

0 Karma
1 Solution

melonman
Motivator

joinでもいいですが、statsでまとめてしまうとわかりやすいです。

例)field1がsourcetype=Aに存在するfield、field2がsourcetpe=Bに存在するfield, zzzが両方のsourcetypeに存在するfieldとすると、

sourcetype=A OR sourcetype=B | stats list(field1) as field1 list(field2) as field2 by zzz

これで、共通のzzzに対して、それぞれのsoucetypeが持っているfield(field1,field2 ...)をグルーピングすることができます。その後に、必要な集計を行うようにするという方法ではどうでしょうか。

View solution in original post

melonman
Motivator

joinでもいいですが、statsでまとめてしまうとわかりやすいです。

例)field1がsourcetype=Aに存在するfield、field2がsourcetpe=Bに存在するfield, zzzが両方のsourcetypeに存在するfieldとすると、

sourcetype=A OR sourcetype=B | stats list(field1) as field1 list(field2) as field2 by zzz

これで、共通のzzzに対して、それぞれのsoucetypeが持っているfield(field1,field2 ...)をグルーピングすることができます。その後に、必要な集計を行うようにするという方法ではどうでしょうか。

Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...