Hi-
I have a Elastic Search Rest API to query along with range condition, which would need to be executed thru Powershell using Invoke-RestMethod command, but it fails. It works alright using Curl.
PowerShell doesn't support a GET request with a body, so you need to use POST instead as @dadoonet suggests.
If you need to work with Elasticsearch frequently with PowerShell, you may be interested in using Elastic.Console, a small PowerShell module that provides cmdlets for
executing requests
API path autocompletion
ability to convert from and execute Kibana Console examples.
Sure @forloop. I'd use the console going forward. I find it very useful. Thanks !
@dadoonet - POST call worked, am able to get the same output as GET calls. I hope the POST method doesn't make any impact to the data we already collected ? thanks !
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.