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!

Index This | Forward, I’m heavy; backward, I’m not. What am I?

April 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

A Guide To Cloud Migration Success

As enterprises’ rapid expansion to the cloud continues, IT leaders are continuously looking for ways to focus ...

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...