Logstash TCP
Logstash TCP モニターには、この Splunk Observability Cloud インテグレーションを 使用してください。メリット、インストール、設定、メトリクスを参照してください
Splunk Distribution of OpenTelemetry Collector は、Smart Agent レシーバを logstash-tcp モニタータイプで使用して、Logstash Monitoring API を通じて Logstash デプロイの健全性とパフォーマンスを監視します。 server または client モードで動作する logstash tcp 出力プラグインからイベントを取得し、それらをデータポイントに変換します。
このインテグレーションは、イベントをメトリクスに変換する Logstash Metrics filterプラグインと組み合わせて使用することを意図しています。このモニターが client モードの場合にのみ、自動検出を使用できます。
このレシーバーはLinuxとWindowsで利用できます。
メリット
インテグレーションを設定すると、これらの機能にアクセスできるようになります:
-
メトリクスを表示します。独自のカスタムダッシュボードを作成することができ、ほとんどのモニターは組み込みのダッシュボードも提供しています。ダッシュボードの詳細については、「Splunk Observability Cloudでダッシュボードを表示する」を参照してください。
-
Infrastructure Monitoring に表示される環境内の物理サーバー、仮想マシン、AWS インスタンス、およびその他リソースのデータ駆動型の視覚化を表示します。ナビゲータの詳細については、「Splunk Infrastructure Monitoring でナビゲーターを使用する」を参照してください。
-
Metric Finder へアクセスし、モニターから送信されたメトリクスを検索します。詳細は、「メトリクス・ファインダーとメタデータ・カタログを検索する」を参照してください。
インストール
このインテグレーションを導入するには、以下の手順に従ってください:
-
Splunk Distribution of OpenTelemetry Collector をホストまたはコンテナプラットフォームにデプロイします:
-
設定のセクションで説明するように、モニターを設定します。
-
Splunk Distribution of OpenTelemetry Collector を再起動します。
設定
Smart Agent モニターとCollector のインテグレーションを使用するには、以下の手順に従います:
-
Smart Agent レシーバーを設定ファイルに含めます。
-
レシーバーセクションおよびパイプラインセクションの両方で、Collector 構成にモニタータイプを追加します。
-
「Collector でSmart Agent モニターを使用する」を参照してください。
-
Smart Agent レシーバーの設定方法を参照してください。
-
一般的な構成オプションのリストについては、「モニターの共通設定」を参照してください。
-
Collector の詳細については、「はじめに:Collector を理解して使用する」を参照してください。
-
例
このインテグレーションを有効にするには、Collector構成に以下を追加します:
receivers:
smartagent/logstash-tcp:
type: logstash-tcp
... # Additional config
次に、設定ファイルの service.pipelines.metrics.receivers セクションにモニターを追加します:
service:
pipelines:
metrics:
receivers: [smartagent/logstash-tcp]
例:Logstash Metricsプラグインの設定
次の例は、Logstash Metrics フィルター・プラグインから timer と meter の両方のメトリクスを使用する方法を示しています:
input {
file {
path => "/var/log/auth.log"
start_position => "beginning"
tags => ["auth_log"]
}
# A contrived file that contains timing messages
file {
path => "/var/log/durations.log"
tags => ["duration_log"]
start_position => "beginning"
}
}
filter {
if "duration_log" in [tags] {
dissect {
mapping => {
"message" => "Processing took %{duration} seconds"
}
convert_datatype => {
"duration" => "float"
}
}
if "_dissectfailure" not in [tags] { # Filter out bad events
metrics {
timer => { "process_time" => "%{duration}" }
flush_interval => 10
# This makes the timing stats pertain to only the previous 5 minutes
# instead of since Logstash last started.
clear_interval => 300
add_field => {"type" => "processing"}
add_tag => "metric"
}
}
}
# Count the number of logins using SSH from /var/log/auth.log
if "auth_log" in [tags] and [message] =~ /sshd.*session opened/ {
metrics {
# This determines how often metric events will be sent to the agent, and
# thus how often data points will be emitted.
flush_interval => 10
# The name of the meter will be used to construct the name of the metric
# in Splunk Infrastructure Monitoring. For this example, a data point called `logins.count` would
# be generated.
meter => "logins"
add_tag => "metric"
}
}
}
output {
# This can be helpful to debug
stdout { codec => rubydebug }
if "metric" in [tags] {
tcp {
port => 8900
# The agent will connect to Logstash
mode => "server"
# Needs to be "0.0.0.0" if running in a container.
host => "127.0.0.1"
}
}
}
Logstashが上記のコンフィギュレーションで構成されると、logstash-tcp モニターは logins.count と process_time.<timer_field> を収集します。
コンフィギュレーション設定
次の表に、このモニタータイプの設定オプションを示します:
|
オプション |
必須 |
タイプ |
説明 |
|---|---|---|---|
|
|
〇 |
|
mode: server の場合、リッスンするローカル IP アドレス。条件
|
|
|
いいえ |
|
mode: server の場合、リッスンするローカルポート。条件
|
|
|
いいえ |
|
server または client として動作するかどうか。対応する
|
|
|
いいえ |
|
(デフォルト: |
|
|
いいえ |
|
TCP接続ができないか、切断された後に
再接続するまでの待機時間。(デフォルト: |
|
|
いいえ |
|
true の場合、Logstashから受信したイベントは、デシリアライズされた形式の
エージェントの標準出力にダンプされます(デフォルト: |
メトリクス
このインテグレーションで利用可能なメトリクスはありません。
トラブルシューティング
If you are a Splunk Observability Cloud customer and are not able to see your data in Splunk Observability Cloud, you can get help in the following ways.
Available to Splunk Observability Cloud customers
-
Submit a case in the Splunk Support Portal.
-
Contact Splunk Support.
Available to prospective customers and free trial users
-
Ask a question and get answers through community support at Splunk Answers.
-
Join the Splunk community #observability Slack channel to communicate with customers, partners, and Splunk employees worldwide.