curl -H "Content-Type: application/json" -XPOST 'http://localhost:9200/_sql' -d 'SELECT COUNT ( DISTINCT dst_port ) AS dst_count,dst_port,src_ip, dst_ip FROM graylog_0 WHERE timestamp > "2017-10-31 11:05:20.000" AND protocol-trans = "TCP" GROUP BY src_ip, dst_ip'
curl -H "Content-Type: application/json" -XPOST 'http://localhost:9200/_sql?format=csv' -d 'SELECT COUNT(DISTINCT dst_port) AS distinct-counts, src_ip, dst_ip FROM graylog_0 WHERE timestamp > "2017-10-31 10:04:00.000" AND protocol-trans = "TCP" GROUP BY dst_ip, src_ip'