Curl command to Delete an Elastic search Index not working

I have been working on Elastic search for a while and i have scenario to delete some indices in the elasticsearch.

As instructed in the ELK user guide, am trying to delete the indices using the CURL command in powershell on Windows Server 2012 R2

The command is given below

$ curl -X DELETE 'http://localhost:9200/logstash-2016.12.19/'

but when i give this command to delete in powershell, it throws the below error

Invoke-WebRequest : A parameter cannot be found that matches parameter name 'X'. At line:1 char:6 + curl -X DELETE 'http://10.242.244.170:9200/logstash-2016.12.19/' + ~~ + CategoryInfo : InvalidArgument: (:slight_smile: [Invoke-WebRequest], ParameterBindingException + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

Can anyone help me solve this issue?

It's a question related to Curl on windows I think. Not related to elasticsearch itself.

That said, may be try with -XDELETE instead of -X DELETE?
Read the documentation of your CURL application.

Yeah I think this is a curl on windows issue, not an ES one.

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