2 Star 1 Fork 2

atompi/Earthling

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
Elasticsearch
Filebeat
Kafka-Eagle
Kibana
LogstashKafka
pipeline
db-slow-pipeline.conf
front-nginx-pipeline.conf
sto-gitlab-pipeline.conf
sto-nginx-pipeline.conf
README.md
docker-compose.yml
logstash.yml
pipelines.yml
docker-images
imgs
.gitignore
README.md
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
db-slow-pipeline.conf 1.30 KB
一键复制 编辑 原始数据 按行查看 历史
input {
kafka {
codec => "json"
bootstrap_servers => "kafka1:9092,kafka2:9192,kafka3:9292"
topics => ["db-slow-log"]
id => "db-slow-log"
consumer_threads => 3
decorate_events => true
auto_offset_reset => "latest"
}
}
filter {
grok {
id => "db-slow-log-grok-sleep-drop"
match => { "message" => "SELECT SLEEP" }
add_tag => [ "sleep_drop" ]
tag_on_failure => []
}
if "sleep_drop" in [tags] {
drop {
id => "sleep_drop"
}
}
grok {
id => "db-slow-log-grok-slowlog"
match => [ "message", "# Time: \d+ %{TIME:time}\s+# User@Host: (?<user>[a-zA-Z0-9._-]*)\[(?:.*)\]\s+@\s+(?<client-domain>\S*)\s+\[%{IP:client-ip}*\]\s.*# Query_time: %{NUMBER:query_time}\s+Lock_time: %{NUMBER:lock_time}\s+Rows_sent: %{NUMBER:rows_sent}\s+Rows_examined: %{NUMBER:rows_examined}\s+SET\s+timestamp=%{NUMBER:timestamp_mysql};\s+(?<query>[\s\S]*)" ]
}
date {
id => "db-slow-log-date"
match => [ "timestamp", "UNIX" ]
remove_field => [ "timestamp" ]
}
}
output {
elasticsearch {
id => "db-slow-log-output-es"
hosts => ["elasticsearch-master:9200","elasticsearch-data-1:9200","elasticsearch-data-2:9200","elasticsearch-data-3:9200"]
user => "elastic"
password => "changeme"
index => "logstash-db-slow-%{+YYYY.MM.dd}"
codec => "json"
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Docker
1
https://gitee.com/atompi/Earthling.git
git@gitee.com:atompi/Earthling.git
atompi
Earthling
Earthling
master

搜索帮助