Hi all,
I have data input like this:
[
{
“id”: 1,
“host”: “abc. com”,
“remote_addr”: “14.161.36.28”,
“request_method”: “GET”,
“request_uri”: “/test.txt”,
},
{
“id”: 2,
“host”: “abc. com”,
“remote_addr”: “14.161.36.28”,
“request_method”: “GET”,
“request_uri”: “/”,
},
{
“id”: 3,
“host”: “abc. com”,
“remote_addr”: “14.161.36.28”,
“request_method”: “GET”,
“request_uri”: “/test.txt”,
},
{
“id”: 4,
“host”: “abc. com”,
“remote_addr”: “14.161.36.29”,
“request_method”: “GET”,
“request_uri”: “/”,
},
{
“id”: 5,
“host”: “abc. com”,
“remote_addr”: “14.161.36.29”,
“request_method”: “GET”,
“request_uri”: “/”,
},
]
but I want to count and output to like this:
{
“static_file”: “/test.txt”,
“static_file_hits”: 2,
“staticfile_visitor”: 2,
},
{
“static_file”: “/”,
“static_file_hits”: 3,
“staticfile_visitor”: 2,
},
static_file = request_uri
static_file_hits = number call to request_uri
staticfile_visitor= number remote_addr call to request_uri
Could you pls help me count and maping data?
Many thanks