Splunk Search

サーチ結果をpie chartに反映する

appleman
Contributor

以下のデータは、A〜Dのネットワークのトラフィックを表しています。
alt text

このA〜Dそれぞれの合計値をパイチャートに結果と反映するために、以下のサーチを組んだのですが、statisticsでは結果が出せても、それをパイチャートに反映させようとすると、Aの値しか認識しませんでした。(何かでくくらないといけないのでしょうが、例えばhostとかでくくるとホストの値が出てしまいます。)
A〜D別の合計値を確実にパイチャートとして表示するためにはどんなサーチをしたらよいのでしょうか。

Search: index=test sourcetype=traffic | stats sum(A) as A sum(B) as B sum(C) as C sum(D) as D

alt text

Tags (3)
0 Karma
1 Solution

melonman
Motivator

なんの結果が必要となるかにもよりますが、上記のsum(A) ... の結果をPieにするには、

index=test sourcetype=traffic | stats sum(A) as A sum(B) as B sum(C) as C sum(D) as D | transpose

とすれば一応、pieで表示できるデータ形式にはなるとおもいます。
どういった情報をpieで表現したいか、内容があっているかどうか、確認いただければとおもいます。

View solution in original post

appleman
Contributor

alt text

このように、Dが一番大きく表示されるはずが、一番小さい値になってしまっています。

0 Karma

melonman
Motivator

なんの結果が必要となるかにもよりますが、上記のsum(A) ... の結果をPieにするには、

index=test sourcetype=traffic | stats sum(A) as A sum(B) as B sum(C) as C sum(D) as D | transpose

とすれば一応、pieで表示できるデータ形式にはなるとおもいます。
どういった情報をpieで表現したいか、内容があっているかどうか、確認いただければとおもいます。

appleman
Contributor

すいません、よく見たらパイチャートの値が小さい方が大きく表示されていたりしていて、これをどうやって結果の数字通りに表示させられますでしょうか?

0 Karma

appleman
Contributor

希望通りの結果だ出せました。ありがとうございました!

0 Karma
Get Updates on the Splunk Community!

Accelerating Observability as Code with the Splunk AI Assistant

We’ve seen in previous posts what Observability as Code (OaC) is and how it’s now essential for managing ...

Integrating Splunk Search API and Quarto to Create Reproducible Investigation ...

 Splunk is More Than Just the Web Console For Digital Forensics and Incident Response (DFIR) practitioners, ...

Congratulations to the 2025-2026 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...