{"id":56512,"library":"elasticsearch-rest-client-sniffer","title":"Elasticsearch REST Client Sniffer","description":"Sniffer component for Elasticsearch REST client that automatically discovers nodes in the cluster.","status":"active","version":"9.4.2","language":"java","source_language":null,"source_url":"https://github.com/elastic/elasticsearch","tags":["elasticsearch","client","sniffer","discovery","rest"],"install":[{"cmd":"<dependency>\n  <groupId>org.elasticsearch.client</groupId>\n  <artifactId>elasticsearch-rest-client-sniffer</artifactId>\n  <version>9.4.2</version>\n</dependency>","lang":"xml","label":"Maven"},{"cmd":"implementation 'org.elasticsearch.client:elasticsearch-rest-client-sniffer:9.4.2'","lang":"groovy","label":"Gradle"}],"dependencies":[],"imports":[{"symbol":"Sniffer","correct":"org.elasticsearch.client.sniff.Sniffer"}],"quickstart":{"code":"import org.elasticsearch.client.RestClient;\nimport org.elasticsearch.client.sniff.Sniffer;\n\nRestClient restClient = RestClient.builder(new HttpHost(\"localhost\", 9200)).build();\nSniffer sniffer = Sniffer.builder(restClient).build();\n// Use restClient for requests\nsniffer.close();\nrestClient.close();","lang":"java","description":"Creates a Sniffer to automatically discover Elasticsearch nodes and attach to a RestClient."},"warnings":[{"fix":"Close the Sniffer first, then the RestClient, typically in a try-with-resources block or finally block.","message":"Sniffer must be closed before the RestClient to avoid resource leaks.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'automat':12 'client':3,10,19 'cluster':17 'compon':6 'discov':13 'discoveri':21 'elasticsearch':1,8,18 'node':14 'rest':2,9,22 'sniffer':4,5,20","created_at":"2026-06-15T10:39:29.406075+00:00","updated_at":"2026-06-15T10:39:29.406075+00:00","problems":[],"ecosystem":"maven","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/elastic/elasticsearch","github":"https://github.com/elastic/elasticsearch","docs":"https://appdoc.app/artifact/org.elasticsearch.client/elasticsearch-rest-client-sniffer/","changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["http-client","networking"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-15","next_check":"2026-12-12","install_tag":null}}