当前位置:网站首页>【笔记】Logstash环境搭建和安装配置
【笔记】Logstash环境搭建和安装配置
2022-07-20 05:07:00 【码农阿福】
Logstash介绍:
概述
Logstash 是 Elastic Stack 的中央数据流引擎,用于收集、丰富和统一所有数据,而不管格式或模式。当与Elasticsearch,Kibana,及 Beats 共同使用的时候便会拥有特别强大的实时处理能力。在这段视频中,Elastic 技术布道师曾勇将会对如何开始 Logstash 进行了概述和演示。
Logstash 是免费且开放的服务器端数据处理管道,能够从多个来源采集数据,转换数据,然后将数据发送到您最喜欢的“存储库”中。
Logstash 能够动态地采集、转换和传输数据,不受格式或复杂度的影响。利用 Grok 从非结构化数据中派生出结构,从 IP 地址解码出地理坐标,匿名化或排除敏感字段,并简化整体处理过程。Logstash主要由三部分组成:
- input:从一个或多个数据源获取数据,常用插件如file、syslog、redis、beats等。
- filter:用来数据过滤、格式转换等,常见插件如grok、mute、drop、geoip等
- output:数据输出,常用插件如elastcisearch、file、statsd等
Logstash下载:
提示:因为是使用Ruby写的,所以需要先安装JAVA JDK,这里不细说怎么安装JDK
建议kibana、es、logstash的版本一致否则会出现兼容性问题
Logstash安装:
解压压缩包即可非常简单
$ tar -zxvf logstash-7.10.2-darwin-x86_64.tar.gz
vim logstash-sample.conf
# Sample Logstash configuration for creating a simple
# Beats -> Logstash -> Elasticsearch pipeline.
input {
beats {
port => 5044
}
}
output {
elasticsearch {
hosts => ["http://localhost:9200"]
index => "%{[@metadata][beat]}-%{[@metadata][version]}-%{+YYYY.MM.dd}"
#user => "elastic"
#password => "changeme"
}
}
Logstash启动:
提示:这里 -e 指的是启动通过命令行进行配置
$ logstash -e 'input { stdin {} } output { stdout {} }'
Using JAVA_HOME defined java: /Library/Java/JavaVirtualMachines/jdk1.8.0_291.jdk/Contents/Home
WARNING, using JAVA_HOME while Logstash distribution comes with a bundled JDK
Sending Logstash logs to /Users/xiaojialiang/module/logstash-7.10.2/logs which is now configured via log4j2.properties
[2022-07-18T19:24:33,639][INFO ][logstash.runner ] Starting Logstash {
"logstash.version"=>"7.10.2", "jruby.version"=>"jruby 9.2.13.0 (2.5.7) 2020-08-03 9a89c94bcc Java HotSpot(TM) 64-Bit Server VM 25.291-b10 on 1.8.0_291-b10 +indy +jit [darwin-x86_64]"}
[2022-07-18T19:24:33,934][WARN ][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified
[2022-07-18T19:24:35,409][INFO ][org.reflections.Reflections] Reflections took 55 ms to scan 1 urls, producing 23 keys and 47 values
[2022-07-18T19:24:36,585][INFO ][logstash.javapipeline ][main] Starting pipeline {
:pipeline_id=>"main", "pipeline.workers"=>8, "pipeline.batch.size"=>125, "pipeline.batch.delay"=>50, "pipeline.max_inflight"=>1000, "pipeline.sources"=>["config string"], :thread=>"#<Thread:0x74a21a6f run>"}
[2022-07-18T19:24:37,477][INFO ][logstash.javapipeline ][main] Pipeline Java execution initialization time {
"seconds"=>0.88}
[2022-07-18T19:24:37,520][INFO ][logstash.javapipeline ][main] Pipeline started {
"pipeline.id"=>"main"}
The stdin plugin is now waiting for input:
[2022-07-18T19:24:37,598][INFO ][logstash.agent ] Pipelines running {
:count=>1, :running_pipelines=>[:main], :non_running_pipelines=>[]}
[2022-07-18T19:24:37,970][INFO ][logstash.agent ] Successfully started Logstash API endpoint {
:port=>9600}
{
"message" => "",
"@version" => "1",
"@timestamp" => 2022-07-18T11:24:37.582Z,
"host" => "xiaoDe-MacBook-Pro.local"
}
边栏推荐
- EF core learning notes: additional foreign key attributes / single navigation attributes
- System learning CV pytorch advanced
- Do you dare to use BigDecimal without mastering these pits?
- Password key hard coding check
- 浏览器工作原理剖析
- CVPR 2020 | Social-STGCNN:基于图卷积的行人轨迹预测
- DOM之事件对象
- 国外域名能注册吗?
- cmake基本语法以及实战项目分析
- Principle of triode
猜你喜欢
[Android development IOS series] Language: swift vs kotlin
How to delete headers, footers and horizontal lines in word documents
Do you dare to use BigDecimal without mastering these pits?
How does excel choose specific numbers to sum? Excel method of selecting specific numbers for summation
[AD learning record] copper clad
【科学文献计量】中英文文献标题及摘要可读性指标分析与可视化
Swagger重点配置项
【 微信小程序请求封装】【进阶版】处理401请求token过期--重新登录--重新发起刚才过期的请求
cmake基本语法以及实战项目分析
2022-7-19 第八小组 顾宇佳 学习笔记 (this关键字和封装)
随机推荐
Technical dry goods | average surface distance of image segmentation based on mindspire
[AD learning record] Why are schematic diagrams and PCBs in the same folder, and PCB cannot be generated?
HMS core graphics and image technology shows the latest functions and application scenarios, and accelerates the construction of digital intelligence life
Learning and using websocket
DNP3 模拟器使用教程
分布式笔记(05)— 分布式锁之 etcd(分布式锁原理、etcd特点、分布式锁实现方案)
webSocket學習與使用
标志信号(flag)
How to choose data application development language and environment
Baidu flying paste application running on embedded ARM
Distributed notes (05) - etcd of distributed lock (distributed lock principle, etcd characteristics, distributed lock implementation scheme)
开发中常见环境配置名词-dev、sit、pro、fac等
Zhimeng adds a column and prompts "failed to save the catalog data, please check whether there is a problem with your input data" when modifying the column
电路板调试
Reverse generation of crud code using Renren generator
How should enterprise users choose aiops or APM?
Fiddler5+ lightning simulator 4.0 settings for app packet capturing
Developers must read: 2022 mobile application operation growth insight white paper
Office software cannot start normally 0xc0000142 how to solve it?
Swift used smamb2 package, and the sad process of repacking