Articles in this section

Enable Query or Request logging for Druid

Query logging (request logging) will capture the queries made and users who made them in the broker log. To enable:
 
1. Add the following to the imply/conf/druid/_common/common.runtime.properties :
 
druid.request.logging.type=slf4j
 
2. Restart your Imply processes.
 
3. In the imply/var/sv/druid/broker.log you will see queries logged in JSON format with the user id.
 
Example output:
 
2018-11-07T16:14:15,378 INFO [DruidSchema-Cache-0] io.druid.sql.calcite.schema.DruidSchema - Refreshed metadata for dataSource[wikipedia] in 447 ms (1 segments queried, 0 segments left).
2018-11-07T16:14:26,574 INFO [qtp404994500-119] io.druid.server.log.LoggingRequestLogger - 2018-11-07T16:14:26.303Z 0:0:0:0:0:0:0:1 {"queryType":"topN","dataSource":{"type":"table","name":"wikipedia"},"virtualColumns":[],"dimension":{"type":"default","dimension":"page","outputName":"page","outputType":"STRING"},"metric":{"type":"LegacyTopNMetricSpec","metric":"sum_deleted"},"threshold":100,"intervals":{"type":"LegacySegmentSpec","intervals":["2016-06-26T21:32:00.000Z/2016-06-27T21:32:00.000Z"]},"filter":null,"granularity":{"type":"all"},"aggregations":[{"type":"doubleSum","name":"sum_deleted","fieldName":"deleted","expression":null}],"postAggregations":[],"context":{"implyDataCube":"wikipedia","implyFeature":"visualization","implyUser":"user","implyView":"wikipedia","implyViewTitle":"Wikipedia","priority":1,"queryId":"9fee261c-dd0d-4949-8376-09661b762841","timeout":40000},"descending":false} {"query/time":265,"query/bytes":7761,"success":true,"identity":"allowAll"}
References:
Was this article helpful?
2 out of 2 found this helpful