I am trying this on cloud ES and Kibana which has credentials to call API. In the example it is not using any credential.
https://www.elastic.co/guide/en/kibana/current/tutorial-build-dashboard.html#_load_the_data_sets
Invoke-RestMethod "http://<host>:<port>/bank/account/_bulk?pretty" -Method Post -ContentType 'application/x-ndjson' -InFile "accounts.json"
Invoke-RestMethod "http://<host>:<port>/shakespeare/_bulk?pretty" -Method Post -ContentType 'application/x-ndjson' -InFile "shakespeare.json"
Invoke-RestMethod "http://<host>:<port>/_bulk?pretty" -Method Post -ContentType 'application/x-ndjson' -InFile "logs.jsonl"
I assume we need to add a header requireAuth, username and password, but i am not sure how to do it.
can someone help me how can I do it? Thanks in advance.