Wednesday, 23 February 2022

show timestamp on elastic index

 1. during create index must add a column with type data like below:


PUT /sample2

{

    "settings" : {

        "number_of_shards" : 3,

        "number_of_replicas" : 2

    }

}

PUT /sample2/_mapping

{

  "properties":{

   "name":{"type":"text"}

    "date":{"type":"date"} 

    

  }

}


or directly insert

POST /sample1/_doc/1

{

  "author": "Beverly Sills2",

  "content": "You may be disappointed if you fail, but you are doomed if you don’t try1.",

  "year": 1930,

  "timestamp":"2022-02-23T16:12:11"

}




-----------------------

open http://localhost:5601/

--> stack manegement--> index pattern ==>  http://localhost:5601/app/management/kibana/indexPatterns


Create new index pattern---> set name and select time stamp field--> save



now you can filter basis on time stamp also.

No comments:

Post a Comment

links for Data Structure

  1) 𝐁𝐞𝐜𝐨𝐦𝐞 𝐌𝐚𝐬𝐭𝐞𝐫 𝐢𝐧 𝐋𝐢𝐧𝐤𝐞𝐝 𝐋𝐢𝐬𝐭:  https://lnkd.in/gXQux4zj 2) 𝐀𝐥𝐥 𝐭𝐲𝐩𝐞𝐬 𝐨𝐟 𝐓𝐫𝐞𝐞 𝐓𝐫𝐚𝐯𝐞𝐫𝐬𝐚𝐥𝐬...