当前位置: 首页 > news >正文

什么站做咨询网站好域名停靠网页推广大全

什么站做咨询网站好,域名停靠网页推广大全,晋城做网站,淘宝网站SEO怎么做ELK框架Logstash配合Filebeats和kafka使用 本文目录 ELK框架Logstash配合Filebeats和kafka使用配置文件结构input为标准输入,output为标准输出input为log文件output为标准输出output为es input为tcpspringboot配置logstash配置 input为filebeatsfilebeats配置logsta…

ELK框架Logstash配合Filebeats和kafka使用

本文目录

    • ELK框架Logstash配合Filebeats和kafka使用
      • 配置文件结构
      • input为标准输入,output为标准输出
      • input为log文件
        • output为标准输出
        • output为es
      • input为tcp
        • springboot配置
        • logstash配置
      • input为filebeats
        • filebeats配置
        • logstash配置
      • input为kafka
        • filebeats设置
        • logstash配置

配置文件结构

配置文件为:logstash.yml

需要自己新建conf文件,设置inputfilteroutput,文件结构如下,自带的logstash-sample.conf内容如下

input { }
filter {}
output {}

启动命令

bin/logstash -f config/logstash.conf

https://www.elastic.co/guide/en/logstash/current/input-plugins.html

input为标准输入,output为标准输出

input { stdin { } 
}
output {elasticsearch { hosts => ["localhost:9200"] }stdout { }
}

input为log文件

output为标准输出

input {# 从文件读取日志信息file {path => "/xxx/demolog/logs/myapp-info.log"type => "ghn"start_position => "beginning"}}output {stdout { codec => rubydebug }
}

output为es

input {# 从文件读取日志信息file {path => "/xxx/demolog/log/demolog-*.log"type => "ghn"start_position => "beginning"}}output {# 输出到 elasticsearchelasticsearch {hosts => ["localhost:9200"] user => "elastic"password => "xxxxxx"ssl => "true"cacert => "/xxx/elk/logstash-8.9.1/config/certs/http_ca.crt"index => "ghn-%{+YYYY.MM.dd}"}stdout {  }
}

input为tcp

配合springboot/springcloud使用

springboot配置

官方github:https://github.com/logfellow/logstash-logback-encoder
在pom.xml添加依赖

        <dependency><groupId>net.logstash.logback</groupId><artifactId>logstash-logback-encoder</artifactId><version>7.4</version></dependency>

在logback-spring.xml添加配置

    <appender name="stash" class="net.logstash.logback.appender.LogstashTcpSocketAppender"><destination>127.0.0.1:4560</destination><!-- encoder is required --><encoder class="net.logstash.logback.encoder.LogstashEncoder" /></appender><root level="info"><appender-ref ref="CONSOLE"/><appender-ref ref="stash" /></root>

logstash配置

input {# 从文件读取日志信息tcp {host => "0.0.0.0"mode => "server"port => 4560codec => json_lines}}output {# 输出到 elasticsearchelasticsearch {hosts => ["localhost:9200"] user => "elastic"password => "xxxxxx"ssl => "true"cacert => "xxx/logstash-8.9.1/config/certs/http_ca.crt"index => "ghn-%{+YYYY.MM.dd}"}stdout { }# stdout { codec => rubydebug }
}
  • logstash终端查看

  • kibana查看

input为filebeats

filebeats配置

  • 配置文件位置:filebeat-8.9.1-darwin-aarch64/filebeat.yml,修改如下部分,指定log位置为springboot的目录
filebeat.inputs:
- type: filestreamenabled: truepaths:- /xxx/xxx/*.log
  • 启动
./filebeat -e -c filebeat.yml -d "publish"

与logstash建立了连接,启动成功

logstash配置

input {beats {port => 5044}
}output {elasticsearch {hosts => ["localhost:9200"] user => "elastic"password => "xxxxxx"ssl => "true"cacert => "/xxxx/logstash-8.9.1/config/certs/http_ca.crt"index => "%{[@metadata][beat]}-%{[@metadata][version]}-%{+YYYY.MM.dd}"}
}
  • 启动logstash
bin/logstash -f config/logstash-filebeat.conf
  • 获取从filebeats发来的日志

kibana

  • kibana中数据视图已经能够看到

  • 查看详情

input为kafka

官方文档:https://www.elastic.co/guide/en/logstash/current/use-filebeat-modules-kafka.html

filebeats设置

output.kafka:hosts: ["localhost:9092"]topic: "filebeat"codec.json:pretty: false
./filebeat -e -c filebeat.yml -d "publish"

logstash配置

input {kafka {bootstrap_servers => ["localhost:9092"]topics => ["filebeat"]codec => json}}output {# 输出到 elasticsearchelasticsearch {hosts => ["localhost:9200"] user => "elastic"password => "xxxxxx"ssl => "true"cacert => "/xxx/elk/logstash-8.9.1/config/certs/http_ca.crt"index => "ghn-%{+YYYY.MM.dd}"}stdout { }# stdout { codec => rubydebug }
}
  • kafka启动

  • logstash查看

  • kafka关闭

https://www.elastic.co/guide/en/logstash/current/plugins-inputs-kafka.html

http://www.hkea.cn/news/118945/

相关文章:

  • 第三方做公司网站谷歌搜索广告优化
  • 网站风格模板快速排名精灵
  • 做网站横幅 的网站推荐几个公司推广
  • html5国内网站建设客户管理软件
  • 网站建设报价单站长工具 seo查询
  • 日本电商网站贵州快速整站优化
  • 物业服务网站建设建立网站要多少钱一年
  • 中铁建设门户加长版廊坊百度提升优化
  • 最便宜的外贸网站建设电商平台运营方案
  • 做网站应该会什么问题网络营销软文范例500字
  • 摄影网课百度关键词优化查询
  • 打广告型的营销网站西安百度推广外包
  • 乌鲁木齐招聘网站建设一站式网络营销
  • 中小型网站建设服务淘宝数据分析工具
  • 梧州网站设计企业网站模板建站
  • 行政事业单位网站建设建议营销策划公司
  • 网络推广网站怎么做百度联盟广告点击一次收益
  • wordpress居中样式宁波seo网络推广外包报价
  • java做网站用到哪些技术网络营销的重要性与意义
  • 网络营销推广的作用谷歌seo什么意思
  • 免费网站建设解决方案郑州网络营销公司哪个好
  • 转转怎么做钓鱼网站税收大数据
  • 株洲专业网站排名优化深圳产品网络推广
  • 深圳美食教学网站制作如何免费搭建自己的网站
  • 兰州移动端网站建设广东整治互联网霸王条款
  • 彩票网站该怎么建设天津seo实战培训
  • 原平的旅游网站怎么做的新冠疫情最新情况最新消息
  • 网站开发软件著作权归谁seo外包
  • 小说网站的网编具体做哪些工作南宁网站快速排名提升
  • 承德网站设计seo互联网营销培训