处理数据后:输入 |过滤器 | output > ElasticSearch 它存储的格式有点像:
"_index": "logstash-2012.07.02",
"_type": "stdin",
"_id": "JdRaI5R6RT2do_WhCYM-qg",
"_score": 0.30685282,
"_source": {
"@source": "stdin://dist/",
"@type": "stdin",
"@tags": [
"tag1",
"tag2"
],
"@fields": {},
"@timestamp": "2012-07-02T06:17:48.533000Z",
"@source_host": "dist",
"@source_path": "/",
"@message": "test"
}
我过滤/存储特定字段中的大部分重要信息,是否可以省略默认字段,如:@source_path 和@source_host?在不久的将来,它将每月存储 80 亿条日志,我想运行一些排除此默认字段的性能测试(我只是不使用这些字段)。
最佳答案
这会从输出中删除字段:
filter {
mutate {
# remove duplicate fields
# this leaves timestamp from message and source_path for source
remove => ["@timestamp", "@source"]
}
}
关于elasticsearch - 在 ElasticSearch 中省略默认的 Logstash 字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15267518/