JSONの特定情報ESデータベースを取り出す方法の例
ESデータベースの情報は次のとおりです. { “_index”: “log_access”, “_type”: “access”, “_id”: “397”, “_version”: 1, “_score”: 1, “_source”: { “method”: “list”, “create_time”: 039, “ip”: “19.6.2.30”, “begin_nao_time”: 3689, “params”: “{“sorts”:[“eventTime:desc”]}”, “httpMethod”: “GET”, “uri”: “/list/0/20”, “url”: “http://19.6.2.30:9510/list/0/20“, “response”: “”, “interval”: 70, “class”: “DataController”, “end_nao_time”: 230 } }
httpMethodの取り出し例
resultは「GET」
httpMethodの取り出し例
String result = getJsonObj.getJSONObject("_source").getJSONObject("httpMethod")
resultは「GET」