Hi Elasticians,
I've created pipeline pipeline_add_ingest_timestamp. I would like to achieve add time of ingesting by elasticsearch to the document using this pipeline. What am I doing wrong? The field is not populate to the document using this pipeline:
PUT _ingest/pipeline/pipeline_add_ingest_timestamp
{
"description": "Adds event.ingested field which represents time of ingestion.",
"processors": [
{
"set": {
"field": "event.ingested",
"value": "{{_ingest.timestamp}}"
}
}
]
}
GET _ingest/pipeline
"pipeline_add_ingest_timestamp" : {
"description" : "Adds event.ingested field which represents time of ingestion.",
"processors" : [
{
"set" : {
"field" : "event.ingested",
"value" : "{{_ingest.timestamp}}"
}
}
]
}
Your ingest pipeline looks good, I copied it to my own Kibana and used the Simulate pipeline API to test it - and it resulted in an event.ingested field with a timestamp in each document.
So I assume your problem is how to trigger the pipeline when you index new documents? For that you need to supply the pipeline-parameter with the name of your pipeline. Let's say you name it "my_timestamp_pipeline" then you need to index new documents like this:
PUT my-index/_doc/my-id?pipeline=my_timestamp_pipeline
{
"foo": "bar"
}
If you use a specific programming language on the client side (Perl, PHP, Python etc) you'll need to look up the documentation for that language to learn how to add the pipeline-parameter with each indexing request.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.