Skip to content

Instantly share code, notes, and snippets.

@rajeevprasanna
Created July 1, 2019 09:24
Show Gist options
  • Save rajeevprasanna/a714415f57eb8703ba9742b10f227980 to your computer and use it in GitHub Desktop.
Save rajeevprasanna/a714415f57eb8703ba9742b10f227980 to your computer and use it in GitHub Desktop.
curl --request POST \
--url http://localhost:8090/druid/indexer/v1/supervisor \
--header 'content-type: application/json' \
--data '{
"type": "kafka",
"dataSchema": {
"dataSource": "meetup-kafka",
"parser": {
"type": "string",
"parseSpec": {
"format": "json",
"flattenSpec": {
"useFieldDiscovery": true,
"fields": [
{
"type": "root",
"name": "response"
},
"rsvp_id",
{
"type": "jq",
"name": "event_name",
"expr": ".event.event_name"
},
{
"type": "jq",
"name": "venue_name",
"expr": ".venue.venue_name"
}
]
},
"timestampSpec": {
"column": "mtime",
"format": "auto"
},
"dimensionsSpec": {
"dimensions": [
"response",
{
"name": "guests",
"type": "long"
},
"event_name",
"venue_name"
]
}
}
},
"metricsSpec": [
{
"type": "count",
"name": "count"
},
{
"type": "longSum",
"name": "guestsSum",
"fieldName": "guests"
}
],
"granularitySpec": {
"type": "uniform",
"segmentGranularity": "DAY",
"queryGranularity": "NONE",
"rollup": false
}
},
"tuningConfig": {
"type": "kafka",
"maxRowsPerSegment": 500000
},
"ioConfig": {
"topic": "meetup",
"consumerProperties": {
"bootstrap.servers": "localhost:9092"
},
"taskDuration": "PT5M",
"useEarliestOffset": "true"
}
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment