用docker 跑 logstash节点 - kibana界面汉化 - logstash tcp

0.docker中logstash的配置文件

[root@VM_0_6_centos pipeline]# cat logstash.yml 
#http.host: "0.0.0.0"
#xpack.monitoring.elasticsearch.url: http://10.0.0.92:9200
可以定义成空,会有一下warn告警

1.首先写下最后的命令

 docker run --rm -it    -v /tmp/pipeline/messages:/usr/share/logstash/config/messages -v /tmp/pipeline/test.conf:
/usr/share/logstash/pipeline/test.conf -v /tmp/pipeline/logstash.yml:/usr/share/logstash/config/logstash.yml docker.elastic.co/logstash/logstash
:6.4.2

2.里面的坑

容器里面定义配置文件的地方

bash-4.2$ cat /usr/share/logstash/config/pipelines.yml
- pipeline.id: main
  path.config: "/usr/share/logstash/pipeline"

3.容器里最终起作用的配置文件的位置

复制代码
cd /usr/share/logstash/pipeline
#################################/usr/share/logstash/pipeline [root@VM_0_6_centos pipeline]# cat test.conf input { file { path
=> ["/usr/share/logstash/config/messages"] type => "nodelog" } } filter { } output { elasticsearch { hosts => ["10.0.0.92:9200"] index => "nodelog-%{+YYY.MM.dd}" } stdout { codec => rubydebug } }
复制代码

4.权限问题:用户要修改成logstash

Bind-mounted configuration files will retain the same permissions and ownership within the container that they have on the
host system. Be sure to set permissions such that the files will be readable and, ideally,
not writeable by the container’s logstash user (UID 1000).

参考:https://www.jianshu.com/p/68ad2cede7c0

https://www.elastic.co/guide/en/logstash/current/docker-config.html#_pipeline_configuration

 

5.logstash tcp 配置

复制代码
input {
  tcp {
    host => "0.0.0.0"
    port => 9250
    mode => "server"
    tags => ["tags"]
    codec => json_lines
  }
  stdin {
  }
}
output {
#  stdout {
#  codec => rubydebug
#  }
  elasticsearch {
    hosts => "10.0.0.9:9200"
  }
}
复制代码

 

posted @   littlevigra  阅读(1395)  评论(3编辑  收藏  举报
编辑推荐:
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 如何调用 DeepSeek 的自然语言处理 API 接口并集成到在线客服系统
· 【译】Visual Studio 中新的强大生产力特性
· 2025年我用 Compose 写了一个 Todo App
点击右上角即可分享
微信分享提示