Preview Transforms - POST /preview/<jobId>

Preview the results of any data pre-processing Transforms.

Examples

The following will send some test data over stdin to the job geo-location:

echo "time,lat,long,location,user_id
2016-03-01 00:00:43,35.6462,139.7066,Tokyo,Bob
2016-03-01 00:03:23,35.733,139.7066,Tokyo,Sue
2016-03-01 00:03:45,35.6317,139.7138,Tokyo,Dave
2016-03-01 00:04:50,35.6317,139.6487,Tokyo,Sally" | curl -X POST -T - "http://localhost:8080/engine/v2/preview/geo-location"

This job would have the following configuration:

{
  "description": "Unusual location",
  "id": "geo-location",
  "analysisConfig": {
    "bucketSpan": 3600,
    "influencers": [ "location" ],
    "detectors": [ {
        "fieldName": "coords",
        "overFieldName": "user_id",
        "detectorDescription": "lat_long(coords) over user_id",
        "function": "lat_long"
      } ]
  },
  "dataDescription": {
    "format": "DELIMITED",
    "timeField": "time",
    "timeFormat": "yyyy-MM-dd HH:mm:ss",
    "fieldDelimiter": ",",
    "quoteCharacter": "\""
  },
  "transforms": [ {
      "transform": "concat",
      "arguments": [ "," ],
      "inputs": [ "lat", "long" ],
      "outputs": [ "coords" ]
    } ]
}

Returns

Status code 202 is returned. The output content is text/plain CSV of the transformed data. All fieldnames are included that will be passed to the Engine API for analysis, and the time field will be converted to epoch:

time,coords,location,user_id
1456790443,"35.6462,139.7066",Tokyo,Bob
1456790603,"35.733,139.7066",Tokyo,Sue
1456790625,"35.6317,139.7138",Tokyo,Dave
1456790690,"35.6317,139.6487",Tokyo,Sally

Errors

See the Error Codes documentation for the full list of errors that may be returned by the API.