Skip to content

ElasticSearch API examples

Prasad Talasila edited this page Jan 26, 2018 · 1 revision

POSTMAN is used to construct requests quickly, save them for later use and analyze the responses sent by the API. Postman can dramatically cut down the time required to test and develop APIs.

Get details about all experiments

URL: http://localhost:9200/protocol/info/_search
Type: POST
Body: {
        "from": 0, "size": 200,
        "query" : {
           "match_all" : {}
        }
      }

Get details about all users

URL: http://localhost:9200/protocol/credentials/_search
Type: POST
Body: {
        "from": 0, "size": 200,
        "query" : {
           "match_all" : {}
        }
      }

Get details about a particular experiment

  • This is a unique <id> created at the initialization of the experiment. This will be of the form of a random number like AVvNAQ9hL96eGG-XF3-R here:
URL: http://localhost:9200/protocol/info/AVvNAQ9hL96eGG-XF3-R (The id of the experiment)
Type: POST
Body: {
        "from": 0, "size": 200,
        "query" : {
           "match_all" : {}
        }
      }

Get details of the analysis of packets in a experiment

  • Get the <id> from the _source term of a particular experiment (which can be obtained by the above request)
  • The <id> will be of the form session_*
  • For example <id> is session_827581779. Attach a protocol_ and perform the query as follows.
URL: http://localhost:9200/protocol_session_827581779/_search
Type: POST
Body: {
        "from": 0, "size": 200,
        "query" : {
           "match_all" : {}
        }
      }
Clone this wiki locally