How to find Elasticsearch Endpoint?

This support forum board is for support questions relating to Nagios Log Server, our solution for managing and monitoring critical log data.
Locked
SuryanuSanyal
Posts: 22
Joined: Wed Sep 15, 2021 5:43 am

How to find Elasticsearch Endpoint?

Post by SuryanuSanyal »

Hi Team,

How to find Elasticsearch endpoint in order to send data to the server for testing?

Thanks in advance
User avatar
pbroste
Posts: 1288
Joined: Tue Jun 01, 2021 1:27 pm

Re: How to find Elasticsearch Endpoint?

Post by pbroste »

Hello @SuryanuSanyal

Thanks for reaching out, want to present the option to call out via API to get the list idices and then retrieve info from specific logstash:

Code: Select all

curl -X GET "localhost:9200/_aliases/0?pretty"
Example list:
{
"my-index-000001" : {
"aliases" : { }
},
"nagioslogserver_log" : {
"aliases" : { }
},
"logstash-2021.07.31" : {
"aliases" : { }
},
"logstash-2021.08.01" : {
"aliases" : { }
},
Then run query on "logstash-2021.08.01" example:

Code: Select all

curl -X GET "localhost:9200/logstash-2021.07.31/_search?pretty"
Example results:
"_index" : "logstash-2021.07.31",
"_type" : "syslog",
"_id" : "AXr53TX6wCTTPdRqeG_S",
"_score" : 1.0,
"_source":{"message":"pam_unix(sudo:session): session opened for user root by (uid=0)\n","@version":"1","@timestamp":"2021-07-31T00:01:01.000Z","type":"syslog","host":"0:0:0:0:0:0:0:1","priority":86,"timestamp":"Jul 30 19:01:01","logsource":"localhost",
Please let us know how things look,
Perry
Locked