我的问题是:如何以表格格式制作JQ输出,用0替换不存在的值?
因此 JQ 的输入是以下 Elastic Search JSON 响应:
{"aggregations": {
"overall": {
"buckets": [
{
"key": "2018-01-18T00:00:00.000Z-2018-01-25T19:33:16.010Z",
"from_as_string": "2018-01-18T00:00:00.000Z",
"to": 1516908796010,
"to_as_string": "2018-01-25T19:33:16.010Z",
"doc_count": 155569,
"agg_per_name": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": [
{
"key": "ASSET-DD583",
"doc_count": 3016,
"totalMaxUptime_perDays": {
"buckets": [
{
"key_as_string": "2018-01-22T00:00:00.000Z",
"key": 1516579200000,
"doc_count": 161,
"totalMaxUptime": {
"value": 77598
}
},
{
"key_as_string": "2018-01-23T00:00:00.000Z",
"key": 1516665600000,
"doc_count": 251,
"totalMaxUptime": {
"value": 80789
}
},
{
"key_as_string": "2018-01-24T00:00:00.000Z",
"key": 1516752000000,
"doc_count": 192,
"totalMaxUptime": {
"value": 56885
} …Run Code Online (Sandbox Code Playgroud)