Delete index from logstash

hi i have 1 summary index , which get refresh once in day .
i want to delete all the data from index every day when logstash run i want to delete data from index or index itself .

here i cant use id column to update value as there will be some data in index which need to get delete ,thats why i need to delete all data from index or index itself .
can any one suggest me approach


You could use Elasticsearch Index Lifecycle Management for that. See more:

life cycle only do index deletion based on timing like (1 day or etc ) i want whenever i load new set of data it should refresh old and then load new .

Logstash is designed to stream data, not perform action either side of a bulk load, so I do not think it is possible.

ok , so if i put this question that way .
day 1 i have sales for 10 item,
day 2 sales for 5 item , so i wan to delete previous 10 item as its old and push new 5 item , what will be approach for this kind of requirement .

If there is one update per day you could use daily indices and just delete the old one, e.g. using ILM. If you need more control I would consider writing a script.

yes data comes once per day but its not daily data , its summary data for last 90 day so i need delete index before push new data .
so there is not any way like (template) or something where from logstash i can delete index ?

No, not that I am aware of.

ok cool , thanks !!

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.