Grafana series-unified display-7-ElasticSearch data source

series of articles

ElasticSearch data source

Grafana has built-in support for Elasticsearch. You can make many types of queries to visualize logs or metrics stored in Elasticsearch and annotate graphs with log events stored in Elasticsearch.

Configure ES data source

The key configurations are as follows:

  • URL: Set the HTTP protocol, IP and port of your Elasticsearch server. like:http://192.168.2.1:9200

index configuration

Elasticsearch data source details

Use the index settings to specify the default value for the time field and the name of your Elasticsearch index. You can use a time pattern, for example YYYY.MM.DD, or a wildcard as the index name. Examples are as follows:

Index name: [applog.*-]YYYY.MM.DD Pattern: Daily Time field name: @timestamp

log configuration

You can optionally configure two Logs parameters:

  • Message field name
  • Level field name

to determine which fields the data source uses for log information and log levels when visualizing logs in Explore.

For example, if you use Filebeat's default settings to send logs to Elasticsearch, then set:

  • Message field name: message
  • Level field name: fields.level

Configure according to your actual situation, such as:

  • Message:
    • _source
  • Level:
    • level

Datalinks create a link from a specified field, which can be accessed in Explore's log view.

The configuration of each data link includes:

Parameter Description
Field Sets the field name used by the data link.
URL/query If the link is external, set the full link URL. If the link is internal, this input will act as a query for the target data source. In both cases you can use ${__value.raw }macros to interpolate values ​​from fields.
URL Label (Optional) Set a custom display label for the link. The link label defaults to the full external URL or the name of the linked internal data source and is overridden by this setting.
Internal link Sets whether the link is internal or external. For internal links, you can use the data source selector to select the target data source. This only supports trace data sources.

The more common configuration of this Data Links comparison here is to trace_idjump to Traces. It will be introduced in detail later.

Example ES data source configuration

The final ES data source configuration example is as follows:

ES Data source settings

EOF

Three people walk together, there must be my teacher; knowledge sharing, the world is for the public. This article is written by Dongfeng Weiming technical blog EWhisper.cn .

Guess you like

Origin blog.csdn.net/east4ming/article/details/130640509