document_id=>”” 为索引提供document id ,对重写elasticsearch中相同id词目很有用 document_type=>” ”事件要被写入的document type,一般要将相似事件写入同一type,可用%{}引用事件type,默认type=log index=>”logstash-%{+YYYY,MM.dd}” 事件要被写进的索引,可是动态的用%{foo}语句 hosts=>[“127.0.0.0...
Logstash数据流中的数据被称之为Event对象,Event以JSON结构构成,Event的属性被称之为字段,如果你像在配置文件中引用这些字段,只需要把字段的名字写在中括号[]里就行了,如[type],对于嵌套字段每层字段名称都写在[]里就可以了,比如:[tags][type];除此之外,对于Logstash的arrag类型支持下标与倒序下表,如:[tags...
document_type => "_doc" } } 1. 2. 3. 4. 5. 6. 7. 在上面的示例中,我们使用elasticsearch输出插件将数据发送到本地的Elasticsearch实例。hosts字段指定Elasticsearch的地址和端口,index字段指定要写入的索引名称,document_type字段指定文档的类型。 保存配置文件并启动Logstash。你可以使用以下命令启动Logstash:...
"type": "long" }, "BId": { "type": "integer" }, "SaleConsultantId": { "type": "integer" }, "AvgReplyDuration": { "type": "integer" }, "AvgReplyRatio": { "type": "double" }, "AvgOnlineDuration": { "type": "integer" }, "StatTime": { "format": "strict_date_optional...
1)DocumentType为日志对象的一个属性,用于指定索引至ES时的document_type; 2)index配置为按月区分日志,需注意:索引名字必须对应template_name,否则将不会使用该处指定的template,此处配置的template_name为"searchlog-*",在新建所有以"searchlog-"开头的索引将使用该template; ...
document_type=>” ”事件要被写入的document type,一般要将相似事件写入同一type,可用%{}引用事件type,默认type=log index=>”logstash-%{+YYYY,MM.dd}” 事件要被写进的索引,可是动态的用%{foo}语句 hosts=>[“127.0.0.0”] ["127.0.0.1:9200","127.0.0.2:9200"] "https://127.0.0.1:9200" ...
document_type: 索引type,对于不同版本的ES集群,该字段有不同的默认值,5.x及以下的集群,默认会使用input中指定的type字段,如果type字段不存在,则该字段的值为doc;6.x的集群,该字段默认值为doc;7.x的集群,该字段默认值为_doc; 8.x的集群,不会使用该字段 ...
document_type 否 当docinfo参数配置为true时,此参数生效。 当docinfo参数配置为false时,需要从配置文件中删除此参数。 document_id 否 当docinfo参数配置为true时,此参数生效。 当docinfo参数配置为false时,需要从配置文件中删除此参数。 cacert 否 默认值“/rds/datastore/logstash/v7.10.0/package/logstash-7.10....
document_type=>” ”事件要被写入的document type,一般要将相似事件写入同一type,可用%{}引用事件type,默认type=log index=>”logstash-%{+YYYY,MM.dd}” 事件要被写进的索引,可是动态的用%{foo}语句 hosts=>[“127.0.0.0”] ["127.0.0.1:9200","127.0.0.2:9200"] "https://127.0.0.1:9200" ...
document\_type => "%{@metadata}" document\_id => "%{@metadata}" routing => "%{@metadata}" } } 参数说明: 注意:客户在实际的生产环境中,如果用到_routing这个字段,就需要迁移_routing,需要在logstash的output里指定routing字段,值是"%{@metadata}"(意思是保持跟来源索引一致),但同时也要在input中...