elasticsearch - 如何在logstash的.conf文件中创建多个索引
问题描述
我使用了以下 .conf 文件,但它给了我一个错误。我的想法是在过滤器中添加更多条件,以便根据 csv 文件获得多索引。
input {
file {
path => "/home/aitor/RETO8/*.csv"
start_position => "beginning"
sincedb_path => "/dev/null"
}
}
filter {
if [path] =~ "df_actualizado.csv" {
mutate { replace => { type => "apache_access" } }
csv {
separator => ","
skip_header => "true"
columns => ['Smart_Meter_1', 'Smart_Meter_2', 'Smart_Meter_3',
'Smart_Meter_4', 'Smart_Meter_5', 'Smart_Meter_6', 'Smart_Meter_7',
'Smart_Meter_8', 'Smart_Meter_9', 'Smart_Meter_10', 'Smart_Meter_11']
}
}
output {
elasticsearch {
hosts => "http://localhost:9200"
index => "%{type}_indexer"
}
stdout {}
}
解决方案
似乎您在 if 语句后缺少括号,导致它保持打开状态。
推荐阅读
- reactjs - React-Redux 不保存状态并始终返回初始值
- kotlin - 来自元素的 Kotlin 子列表
- java - 为什么使用不带菱形运算符的 List 作为方法参数类型会导致编译错误?
- android - 如何从另一个模块调用活动
- java - 创建没有完整文件路径的文件 - java
- react-native - 反应原生的网络断开屏幕
- javascript - 如何在一个史诗 [redux-observable] 中发出两个请求?
- swift - 在 Swift 上自动创建 arraylist 对象
- java - 策略模式可以包含对父类的引用吗?
- backup - 重复性不将备份推送到 OVH swift 容器