I would like to create a daily index in elastic 7
Somthing like the one in the example bellow:
[elasticsearch@elk7-lab ~]$ curl -X GET 'http://172.xx.xxx.xx:9200/_cat/indices?v'
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
....
green open .monitoring-es-7-2019.09.18 g6zJRXCGR3qK9bRiYjfTNg 1 0 93679 105938 55mb 55mb
.....
I run the following command:
[elasticsearch@elk7-lab ~]$ curl -X PUT 'http://172.xx.xxx.xx:9200/yoav1_yyyy.mm.dd'
{"acknowledged":true,"shards_acknowledged":true,"index":"yoav1_yyyy.mm.dd"}
And it show that the index create as a string and not with the date format :
What Logstash does behind the scenes is to calculate the index name based on the template and the @timestamp field and then put this in a bulk request. You probably need to do something similar in Spark. You could also use rollover as this allows you to index into an alias and have Elasticsearch create time-based indices based on age and/or size in the background.
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.