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

logstash配置文件

input {
kafka {
topics => “xxxx”
bootstrap_servers => “ip:port”
auto_offset_reset => “xxxx”
group_id => “xxxx”
consumer_threads => 3
codec => “json”
}
}

filter {
grok {
match => {
“message” => ‘%{IP:client_ip} - - [%{HTTPDATE:timestamp}] “%{WORD:http_method} %{URIPATHPARAM:request_path} HTTP/%{NUMBER:http_version}” %{NUMBER:http_response_code} %{NUMBER:response_size} “%{URI:http_referer}” “%{DATA:user_agent}” “-”’
}
}

mutate {
add_field => {
“[parsed][client_ip]” => “%{client_ip}”
“[parsed][timestamp]” => “%{timestamp}”
“[parsed][http_method]” => “%{http_method}”
“[parsed][request_path]” => “%{request_path}”
“[parsed][http_version]” => “%{http_version}”
“[parsed][http_response_code]” => “%{http_response_code}”
“[parsed][response_size]” => “%{response_size}”
“[parsed][http_referer]” => “%{http_referer}”
“[parsed][user_agent]” => “%{user_agent}”
}

merge => { “client_ip” => “message” }

remove_field => ["client_ip", "timestamp", "http_method", "request_path", "http_version", "http_response_code", "response_size", "http_referer", "user_agent"]

}

}

output {
elasticsearch {
user => “elastic”
password => “xxxxx”
hosts => [“ip:port”]
index => “%{[type]}-%{[@metadata][index_day]}”
document_type => “%{[type]}”
}
}
最终实现的效果:
在这里插入图片描述

http://www.lryc.cn/news/130109.html

相关文章:

  • docker搭建lnmp(nginx+mysql57+php7.4)
  • 专访 BlockPI:共建账户抽象未来的新一代 RPC 基础设施
  • js fetch请求中断的几种方式
  • Python自动化实战之使用Selenium进行Web自动化详解
  • “之江数据安全治理论坛”暨《浙江省汽车数据处理活动规定(专家建议稿)》研讨会顺利召开
  • 消息中间件面试题
  • 麻辣烫数据可视化,麻辣烫市场将持续蓬勃发展
  • 大数据课程J1——Scala的概述
  • 第二章:25+ Python 数据操作教程(第十三节NUMPY 教程与练习)
  • 【Java面试】如果一个线程两次调用start(),会出现什么问题?
  • 购买steam余额有风险吗?以及N种被红锁的情况
  • 使用 BERT 进行文本分类 (02/3)
  • 基于Hadoop的表级监管
  • 【学习日记】【FreeRTOS】延时列表的实现
  • ​LeetCode解法汇总833. 字符串中的查找与替换
  • ide internal errors【bug】
  • 阿里云与中国中医科学院合作,推动中医药行业数字化和智能化发展
  • 【Redis】Redis 的学习教程(五)之 SpringBoot 集成 Redis
  • github以及上传代码处理
  • 【PACS源码】认识PACS的架构和工作流程
  • 【C++】开源:跨平台Excel处理库-libxlsxwriter配置使用
  • 前端-轮询
  • Python “贪吃蛇”游戏,在不断改进中学习pygame编程
  • Linux网络编程_Ubuntu环境配置安装
  • gradle java插件
  • 神经网络基础-神经网络补充概念-48-rmsprop
  • 分析Flink,源和算子并行度不一致时,运行一段时间后,看似不再继续消费的问题,提供解决思路。
  • PyTorch训练深度卷积生成对抗网络DCGAN
  • Spring-4-掌握Spring事务传播机制
  • [PyTorch][chapter 49][创建自己的数据集 1]