什么是 ELK/Grafana

ELK

Data Flow in ELK Stack: Logstash (Collect & Transform) → Elasticsearch (Store & Search) → Kibana (Visualize)

Elasticsearch

Explore Elasticsearch Query DSL

What is Elasticsearch?

Elastic (formerly Elasticsearch) is a suite of open-source tools for search, analytics, and data visualization, built around the core Elasticsearch engine. It's widely used for:

  • Full-text search: like Google for your data.
  • Log and metric analysis: centralized logging with the ELK Stack.
  • Business analytics: dashboard, trends, machine learning.

Elasticsearch enables you to build powerful search experiences for websites, applications, and enterprise data using Elastic's unified platform.

How to use Elasticsearch?

sql 复制代码
GET /_search
{
  "query": {
    "bool": {
      "must": [
        { "match": { "title":   "Search"        }},
        { "match": { "content": "Elasticsearch" }}
      ],
      "filter": [
        { "term":  { "status": "published" }},
        { "range": { "publish_date": { "gte": "2015-01-01" }}}
      ]
    }
  }
}
  • Elasticsearch's native interface is HTTP-based, and requests/responses are typically in JSON.
  • Elasticsearch provides official clients for multiple languages, which handle JSON internally.
  • Tools with non-json interfaces: Kibana query language(KQL), SQL(not natively) interface, command line tools.
  • Graphical interfaces: Kibana dev tools, elastic search head(plugin).
  • ETL tools: Logstash, beats.

Logstash

Try the Logstash Quick Start

What is Logstash?

Logstash is an open-source data processing pipeline tool developed by Elastic. It ingests, transforms, and ships data from various sources (logs, databases, APIs) to destinations like Elasticsearch, databases, or cloud storage.

How to use Logstashs?

A Logstashs pipeline has 3 stages: Input → Filter → Output.

Example config file (logstash.conf):

ruby 复制代码
input {
  file {
    path => "/var/log/nginx/access.log"  # Read Nginx logs
    start_position => "beginning"
  }
}

filter {
  grok {
    match => { "message" => "%{COMBINEDAPACHELOG}" }  # Parse log format
  }
  date {
    match => [ "timestamp", "dd/MMM/yyyy:HH:mm:ss Z" ]  # Fix timestamp
  }
}

output {
  elasticsearch {
    hosts => ["http://localhost:9200"]  # Send to Elasticsearch
    index => "nginx-logs-%{+YYYY.MM.dd}"
  }
}

Kibana

What is Kibana?

Kibana is the visualization and management UI for the Elastic Stack.

Kibana vs. Kusto

  • Kusto KQL: Used in Microsoft's ecosystem (Azure). Kusto is a cloud-based data analytics engine by MS (Azure Data Explorer).
  • Kibana KQL: Used in Elastic's ecosystem (Kibana). Kibana is a visualization/dashboard tool for Elasticsearch (part for ELK stack).

How to use Kibana?

Grafana

Explore Grafana Labs Tutorials

What is Grafana?

Grafana is an open-source dashboard and visualization tool designed for monitor and analyzing time-series data. It connect to multiple data sources (like Elasticsearsh, MySQL, stc.) and lets you to create interactive dashboards with charts, graphs, and alerts.

Grafana vs. Kibana

  • Grafana is better for time-series metrics. e.g. infrastructure monitoring (CPU, network)

  • Kibana excels at log exploration.

    Logs → Logstash/Beats → Elasticsearch → Kibana (logs)
    Metrics → Prometheus → Grafana (metrics)

How to use Grafana?

Try the Grafana Playground (pre-built demos).

相关推荐
会飞的小蛮猪5 小时前
Jenkins运维之路(权限分配&忘记admin密码)
java·运维·经验分享·jenkins·prometheus
Wezzer13 小时前
jenkins使用ansible单节点lnmp
运维·ansible·jenkins
白毛大侠13 小时前
如何安全地删除与重建 Elasticsearch 的 .watches 索引
大数据·elasticsearch·jenkins
文化人你不懂得14 小时前
Jenkins环境搭建与使⽤
运维·ci/cd·jenkins
川石课堂软件测试16 小时前
Oracle 数据库:视图与索引
数据库·网络协议·nginx·http·oracle·grafana·prometheus
川石课堂软件测试1 天前
Oracle 数据库如何查询列
linux·数据库·sql·功能测试·oracle·grafana·prometheus
zzu123zsw1 天前
第15章 Jenkins最佳实践
运维·jenkins
小薛博客1 天前
26、Jenkins流水线
java·servlet·jenkins
deeper_wind1 天前
Jenkins主机中安装ansible部署lnmp论坛(小白的”升级打怪“成长之路)
linux·ansible·jenkins
SH11HF1 天前
Jenkins调用ansible部署lnmp平台
运维·ansible·jenkins