什么是 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).

相关推荐
東雪蓮☆8 小时前
ELK 企业级日志分析系统实战教程
linux·运维·elk
INFINI Labs14 小时前
Easysearch 国产替代 Elasticsearch:8 大核心问题解读
大数据·elasticsearch·搜索引擎·jenkins·easysearch
wodongx12316 小时前
从零开始部署Android环境的Jenkins CI/CD流水线(docker环境,Win系统)
android·docker·jenkins
oLingXi1216 小时前
Unity开发CI/CD工具Jenkins的安装(Windows10)
运维·unity·ci/cd·jenkins
zcz16071278211 天前
从 ZooKeeper 到 ELK:分布式中间件与日志分析系统全解析
分布式·elk·zookeeper
weixin_507847951 天前
ELK企业级日志分析系统
elk
运维成长记1 天前
ELK大总结20250922
elk
ThreeAu.1 天前
Jenkins+Tomcat持续集成教程
ci/cd·tomcat·jenkins
会飞的鱼_1231 天前
企业级日志分析利器:ELK Stack从入门到实战部署
运维·elk
BatyTao1 天前
第十三章 Ant与Jenkins的集成
jmeter·jenkins·ant