Load The Data Set KIBANA

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.

https://virtuallysober.com/2018/01/04/introduction-to-powershell-rest-api-authentication/ has a few options you could try.

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