Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### Create the ingest pipeline
- ``` json
- PUT _ingest/pipeline/timestamp
- {
- "description": "Add a timestamp field to a document at the time of the ingestion",
- "processors": [
- {
- "set": {
- "field": "@timestamp",
- "value": "{{_ingest.timestamp}}"
- }
- }
- ]
- }
- ```
- ### Create a index / document using the pipeline
- ```
- POST auto_timestamp/_doc?pipeline=timestamp
- {
- "msg": "Timestamp auto-generation"
- }
- ```
- ### Search the created document
- ```
- GET auto_timestamp/_search
- ```
- ### Result
- ```
- "hits" : [
- {
- "_index" : "auto_timestamp",
- "_type" : "_doc",
- "_id" : "uqNXJGoBvxBjcKDft4xM",
- "_score" : 1.0,
- "_source" : {
- "msg" : "Check out the automated Timestamp generation!",
- "@timestamp" : "2019-04-16T04:11:29.484Z"
- }
- }
- ]
- ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement