如下是一条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为例
String result = getJsonObj.getJSONObject("_source").getJSONObject("httpMethod")
result为”GET”
本文介绍了一条Elasticsearch数据库中的具体记录详情,包括索引、类型、ID等元数据及请求方法、创建时间、IP地址等具体内容。展示了如何从JSON格式的数据中提取httpMethod字段。

706

被折叠的 条评论
为什么被折叠?



