Test parsing lookup data in Dynatrace with the Grail Resource Store API and preview the records produced by a DPL pattern without saving them.
| POST | SaaS | https://{your-environment-id}.apps.dynatrace.com/v1/files/tabular/lookup:test-pattern |
Test parsing lookup data without storing the result in the Grail Resource Store.
The request body needs to be submitted as multipart/form-data with the following parts:
The uploaded data is parsed using the Dynatrace Pattern Language (DPL). For examples, see the Dynatrace Documentation.
parsePattern (required) - The DPL pattern to parse the uploaded data. Every pattern match
produces a record. Example: LD:id ',' LD:value.
skippedRecords - The number of initial records to discard. Can be used to skip header rows.
Default: 0
lookupField - The name of the lookup field whose value identifies a record in
the lookup data. The uniqueness of the values is ensured by deduplicating records during
upload, if necessary.
timezone - The timezone for parsing time and date fields. The list of valid input values
matches that of the IANA Time Zone Database (TZDB). Example: UTC.
locale - The locale for parsing locale-specific day and month names. The input values take the
ISO-639 Language code with an optional ISO-3166 country code appended to it with an underscore.
Example: en_US.
autoFlatten - Set to true to extract nested fields to the root level when the specified DPL
pattern results in a single record-type field. Default: true
To execute this request, you need a platform token or OAuth access token with storage:files:write scope. To learn how to obtain and use it, see Tokens and authentication.
| Parameter | Type | Description | In | Required |
|---|---|---|---|---|
| body | Resource | Multipart request containing JSON metadata and file content. | body | Optional |
ResourceTestPatternRequestEnvelope objectMultipart request containing JSON metadata and file content.
| Element | Type | Description | Required |
|---|---|---|---|
| content | string | - | Required |
| request | Resource | The JSON metadata for the test pattern request. | Required |
ResourceTestPatternRequest objectThe JSON metadata for the test pattern request.
| Element | Type | Description | Required |
|---|---|---|---|
| autoFlatten | boolean | Set to true to extract nested fields to the root level when the specified DPL pattern results in a single record-type field. | Optional |
| locale | string | The locale for parsing locale-specific day and month names. The input values take the ISO-639 Language code with an optional ISO-3166 country code appended to it with an underscore. | Optional |
| lookupField | string | The name of the lookup field whose value identifies a record in the lookup data.The uniqueness of the values is ensured by deduplicating records during upload, if necessary. | Optional |
| parsePattern | string | The DPL pattern to parse the uploaded data. Every pattern match produces a record. | Required |
| skippedRecords | integer | The number of initial records to discard. Can be used to skip header rows. | Optional |
| timezone | string | The timezone for parsing time and date fields. The list of valid input values matches that of the IANA Time Zone Database (TZDB). | Optional |
This is a model of the request body, showing the possible elements. It has to be adjusted for usage in an actual request.
{"content": "string","request": {"autoFlatten": true,"locale": "en_US","lookupField": "id","parsePattern": "LD:id ',' LD:value","skippedRecords": 0,"timezone": "UTC"}}
| Code | Type | Description |
|---|---|---|
| 200 | Resource | The result of applying the pattern to the uploaded file. The schema for the |
| 400 | Error | Bad request for uploading the lookup data. |
| 401 | Error | Unauthorized. |
| 403 | Error | Access forbidden. |
| 413 | Error | The uploaded file or the JSON request were too large. |
| 429 | Error | Too many concurrent requests. |
| 500 | Error | Internal Server Error |
| 4XX | Error | Client Error |
| 5XX | Error | Server Error |
ResourceTestPatternResponse objectThe result of applying the pattern to the uploaded file.
| Element | Type | Description |
|---|---|---|
| numberOfRecords | integer | The total number of records in the uploaded file that match the provided pattern. |
| records | object[] | List of records that result from applying the pattern to the uploaded file. If there are more than 100 records, this list contains only the first 100. |
| types | object[] | The data types for the result records. |
ErrorEnvelope object| Element | Type | Description |
|---|---|---|
| error | Exceptional | - |
ExceptionalReturn object| Element | Type | Description |
|---|---|---|
| code | integer | - |
| errorDetails | (Custom | - |
| message | string | - |
CustomValidationErrorInfo objectErrorInfo object| Element | Type | Description |
|---|---|---|
| message | string | - |
InvalidAuditEventsErrorInfo objectMediaTypeErrorInfo objectParameterErrorInfo objectProxyErrorInfo objectQueryFrontendRawErrorInfo objectRequestBodyErrorInfo object{"numberOfRecords": 3,"records": [{"code": "200","message": "OK"},{"code": "400","message": "Bad Request"},{"code": "500","message": "Internal Server Error"}],"types": [{"indexRange": [0,2],"mappings": {"code": {"type": "long"},"message": {"type": "string"}}}]}
{"error": {"code": 400,"message": "Testing pattern failed: Parse pattern must not be blank."}}