gpt4 book ai didi

logging - ElasticSearch服务拥有日志

转载 作者:行者123 更新时间:2023-12-02 23:39:10 25 4
gpt4 key购买 nike

我按照https://www.digitalocean.com/community/tutorials/how-to-use-logstash-and-kibana-to-centralize-and-visualize-logs-on-ubuntu-14-04中描述的步骤在Ubuntu计算机上安装了ELK(ElasticSearch + Kibana + Logstash)。

将/ var / log / syslog文件用作日志源时,所有方法都可以正常工作。如果我更改为另一个文件,则Kibana界面中不会显示任何数据。我尝试调试应用程序,但在以下位置找不到有用的信息:

/ var / log / elasticsearch
/var/log/logstash/logstash.log
/ var / log / syslog


有人知道在哪里可以找到先前指定文件旁边的ElasticSearch,Logstash和Logstash-Forwarder的详细日志记录?

TLDR;
其中ElasticSearch,Logstash和Logstash-Forwarder在/ var / log / elasticsearch旁边输出其日志; /var/log/logstash/logstash.log; / var / log / syslog?

最佳答案

您想要在LogStash中设置处理程序以使用ElasticSearch的日志。我提出了一个模式来帮助解决这个问题(下面详细介绍)。就像是:

input {
file {
type => "elasticsearch-log"
path => ["/var/log/elasticsearch/*.log"]
sincedb_path => "/opt/logstash/sincedb-access"
discover_interval => 10
}
}

filter {
if [type] == "elasticsearch-log" {
grok {
match => [ "message", "%{ELASTICSEARCHLOG}" ]
}
}
}

output {
elasticsearch {
host => "localhost"
}
}

模式文件将输入 /opt/logstash/patterns/elasticsearch
ELASTICSEARCHTIME \[%{TIMESTAMP_ISO8601:timestamp}\]
ELASTICSEARCHLEVEL \[%{LOGLEVEL:level}\s+\]
ELASTICSEARCHSERVICE \[%{DATA:service}\s+\]
ELASTICSEARCHVERSION \[%{DATA:version}\]
ELASTICSEARCHLOG %{ELASTICSEARCHTIME}%{ELASTICSEARCHLEVEL}%{ELASTICSEARCHSERVICE} %{ELASTICSEARCHVERSION} %{GREEDYDATA:mymessage}

关于logging - ElasticSearch服务拥有日志,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25741245/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com