栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 前沿技术 > 大数据 > 大数据系统

Logstash 启动多个索引

Logstash 启动多个索引

input {

file {

path => "/root/logs/*/*.log"

start_position => beginning

type => "applog"

codec => json {

charset => "UTF-8"

}

}

file {

path => "/root/logs/drtPersonCenter/*.log"

start_position => beginning

type => "personcenter"

codec => json {

charset => "UTF-8"

}

}

file {

path => "/root/logs/drtFinance/*.log"

start_position => beginning

type => "finance"

codec => json {

charset => "UTF-8"

}

}

file {

path => "/root/logs/drtElec/*.log"

start_position => beginning

type => "elec"

codec => json {

charset => "UTF-8"

}

}

file {

path => "/root/logs/drtShop/*.log"

start_position => beginning

type => "shop"

codec => json {

charset => "UTF-8"

}

}

file {

path => "/root/logs/drtStatistics/*.log"

start_position => beginning

type => "statistics"

codec => json {

charset => "UTF-8"

}

}

file {

path => "/root/logs/drtOperationPlatform/*.log"

start_position => beginning

type => "operationPlatform"

codec => json {

charset => "UTF-8"

}

}

}

filter {

mutate {

split => [ "upstreamtime", "," ]

}

}

output {

if "_grokparsefailure" in [tags] {

}else{

if [type] == "applog"{

elasticsearch {

hosts => ["http://192.168.240.15:9200"]

index => ["applog"]

}

}

if [type] == "personcenter"{

elasticsearch {

hosts => ["http://192.168.240.15:9200"]

index => ["person_logs"]

}

}

if [type] == "finance"{

elasticsearch {

hosts => ["http://192.168.240.15:9200"]

index => ["finance_logs"]

}

}

if [type] == "elec"{

elasticsearch {

hosts => ["http://192.168.240.15:9200"]

index => ["elec_logs"]

}

}

if [type] == "shop"{

elasticsearch {

hosts => ["http://192.168.240.15:9200"]

index => ["shop_logs"]

}

}

if [type] == "statistics"{

elasticsearch {

hosts => ["http://192.168.240.15:9200"]

index => ["statistics_logs"]

}

}

if [type] == "operationPlatform"{

elasticsearch {

hosts => ["http://192.168.240.15:9200"]

index => ["opr_logs"]

}

}

}

stdout { codec => rubydebug }

}

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/389223.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号