Elasticsearch index

I have to remove old data of apiman-indices in Elasticsearch which contain .pos, .cf or any other extension. So how can we remove the old indices?

Do you mean you have to remove the documents (events) in you indices with this information?

If so, is this stored in a specific field or part of a field?

yes how can i remove this

You should be able to do this with a delete_by_query

Could you perhaps share an example doc?

There are many ways to do it:

  1. if you know the doc id which needs to be removed use:
    DELETE /<index>/_doc/<_id>

  2. if you have many docs to be remove then use ( which can be identified via a query) then use :

POST /my-index-000001/_delete_by_query
{
  "query": {
    "match": {
      "user.id": "elkbee"
    }
  }
}
  1. if you want to delete the index itself then use :
    DELETE /<index>

yiu can use all these apis in kibana interface .

1 Like

NO no, Actually i want to remove APIMAN-METRICS in Elasticsearch which is very old and consume lot of spaces. data stored in APIMAN-METRICS is .cfs, .pos this type of form so how can i delete this type of data. it directly not shown in JSON format. How can i delete this?

It's confusing. Isn't APIMAN-METRICS is a field of some index in your Elasticsearch cluster? Why it is not shown and if it is not shown, how to specify the documents??

@umangpatel

Please run these in Kibana Dev Tools and share the output

GET /

GET _cat/indices?v

Then perhaps we can help.

Sorry, but We have using oldest version of kibana. And i can't see kibana dev tools in kibana dashboards. what's next step?

What version of Elasticsearch are you running?

The equivalent commands can be run using curl fro

curl http://<elasticsearch hostname>:9200/

etc that should show the version.

curl http://<elasticsearch hostname>:9200/_cat/indices/?v

We have using ES version 1.7.2

That is incredibly old and EOL and assuming there's any data of value in there, you should seriously consider upgrading.

Those commands should still work.

Run the _cat indices and show us what the result is.

Pl find screenshot. Result of above command
indices

A) Do want to completely remove the entire apiman index, completely remove it?

B) Or just certain documents from inside the apiman index an leave the rest of the documents?

No no, I want to remove just 6 months old documents inside apiman index. Not remove entire apiman index.

Any Update on this..

You will need to get the index back to green then use delete_by_query as suggested above... Only way to do what you want.

How to get the index back to green?

Good question...

Run

This

And this

And show The full output in text not a screenshot and perhaps we can help.

OK, I will check and send a results to you