API for graylog-datanode

Hello everyone. I’ve run into the following problem: Graylog version 7.3 — graylog‑server and graylog‑datanode are installed on the same physical server. I need to access the API to manage indices via the terminal (use bash scripts to check the number of indexes and delete them under certain conditions). If I run

curl -X GET “http://localhost:9200/”

in the terminal, I get the response:

curl: (52) Empty reply from server.

When i had a grayog 5, this works fine.

At this stage, I need help. thx in advance

Hello @igoriceg,

Data Node implements Opensearch Security which means you would need to use either a JWT token or client certs to access the Opensearch API.

You can download the cert via ui under System/Cluster Configuration/Certificate Management

You should then use those certs with the curl and use https.

curl --cert client.crt --key client.key --cacert ca.crt \
“https://localhost:9200/”