简体   繁体   English

如何将路径字段添加到 ElasticSearch 索引中的每个文档?

[英]How to add path field to every document in an ElasticSearch index?

While pushing logs from local to ES using file input plugin, a path field gets added which contains the actual path of the log file which the document was created from.使用文件输入插件将日志从本地推送到 ES 时,会添加一个path字段,其中包含创建文档的日志文件的实际路径。 But this field doesn't show up when using the AWS s3 input plugin.但是在使用 AWS s3输入插件时不会显示此字段。 How do I add it?我如何添加它?

My s3 input plugin:我的 s3 输入插件:

s3 {
      "access_key_id" => "***"
      "secret_access_key" => "***"
      "backup_to_dir" => "/home/xyz/aws_s3_backup_data/"
      "bucket" => "bucket"
      "prefix" => "folder/dir/"
   }

看起来他们将其添加为[@metadata][s3][key] ,尽管它不在文档中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何让elasticsearch将时间戳字段添加到所有索引中的每个文档? - How to make elasticsearch add the timestamp field to every document in all indices? 如何在elasticsearch中索引包含ZonedDateTime字段的文档 - How to index document containing ZonedDateTime field in elasticsearch 如何避免Elasticsearch Bulk API中每个文档的索引 - How to avoid index for every document in elasticsearch bulk API 如何通过索引文档中字段的部分文本来搜索Elasticsearch索引? - How to search a elasticsearch index by partial text of a field in the indexed document? Elasticsearch 5.4.0 - 如何向现有文档添加新字段 - Elasticsearch 5.4.0 - How to add new field to existing document 用字段条件替换 Elasticsearch 索引中的文档 - Replace document in Elasticsearch index with field condition 使用现有的“ id”字段索引Elasticsearch文档 - index Elasticsearch document with existing “id” field 比较elasticsearch索引中不同的文档字段值 - Comparing the different document field values in elasticsearch index 如何在 elasticsearch 中索引 csv 文档? - How to index a csv document in elasticsearch? 在 ElasticSearch 中的每个字段上添加简单搜索 - Add simple search on every field in ElasticSearch
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM