|
|
## logstash插件升级
|
|
|
|
|
|
### 环境:
|
|
|
|
|
|
> os: centos 7.7
|
|
|
|
|
|
> ip: 10.8.6.246
|
|
|
|
|
|
> logstash版本:6.7.0
|
|
|
|
|
|
```
|
|
|
/usr/share/logstash/bin/logstash -V
|
|
|
```
|
|
|
|
|
|
### 查看当前插件版本:
|
|
|
|
|
|
```
|
|
|
/usr/share/logstash/bin/logstash-plugin list --verbose
|
|
|
```
|
|
|
|
|
|
会看到如下
|
|
|
|
|
|
```
|
|
|
...
|
|
|
logstash-filter-urldecode (3.0.6)
|
|
|
logstash-filter-useragent (3.2.3)
|
|
|
logstash-filter-xml (4.0.7)
|
|
|
logstash-input-beats (5.1.8)
|
|
|
logstash-input-dead_letter_queue (1.1.4)
|
|
|
logstash-input-elasticsearch (4.3.0)
|
|
|
logstash-input-exec (3.3.2)
|
|
|
logstash-input-file (4.1.9)
|
|
|
...
|
|
|
```
|
|
|
|
|
|
### 备份当前版本(可选)
|
|
|
|
|
|
```
|
|
|
/usr/share/logstash/bin/logstash-plugin prepare-offline-pack logstash-input-file
|
|
|
```
|
|
|
|
|
|
会打包当前版本的插件
|
|
|
|
|
|
```
|
|
|
(base) [root@bdp-c-204 service]# /usr/share/logstash/bin/logstash-plugin prepare-offline-pack logstash-input-file
|
|
|
Offline package created at: /usr/share/logstash/logstash-offline-plugins-6.7.0.zip
|
|
|
|
|
|
You can install it with this command `bin/logstash-plugin install file:///usr/share/logstash/logstash-offline-plugins-6.7.0.zip`
|
|
|
```
|
|
|
|
|
|
后续如果回滚,可以从本地安装
|
|
|
|
|
|
### 升级指定插件
|
|
|
|
|
|
我们要升级**logstash-input-file (4.1.9)**到最新版本
|
|
|
|
|
|
```
|
|
|
/usr/share/logstash/bin/logstash-plugin update logstash-input-file
|
|
|
```
|
|
|
|
|
|
成功后可以看到提示**Updated logstash-input-file 4.1.9 to 4.2.4**
|
|
|
|
|
|
---
|
|
|
|