Aws cloudtwatch stats function in Grafana fetching HTML table instead of plain data

I am writing the CloudWatch Logs query in Grafana.

  1. When I am using the below query its gives me plain JSON data & I can display that in Table. One thing is, it gives me time in 1631703030041 formats.

    fields @timestamp, status, jobId, office
    | filter ispresent(jobId) and ispresent(status) and ispresent(office)
    | sort @timestamp desc

  2. But I want to apply group by in query so I am using the stats function of Aws CloudWatch. When I add the stats function it gives me instead of JSON it gives me HTML Table.

    fields @timestamp, status, jobId, office
    | filter !isempty(jobId) and !isempty(status) and !isempty(office)
    | stats latest(status), max(@timestamp) by jobId, office
    | sort jobId

How do I remove the HTML table from the Stats query? Let me know if I missing something. On Aws CloudWatch it is showing properly.