The Query Usage workflow will be using the `query-parser` processor.
After running a Metadata Ingestion workflow, we can run Query Usage workflow.
While the `serviceName` will be the same to that was used in Metadata Ingestion, so the ingestion bot can get the `serviceConnection` details from the server.
### 1. Define the YAML Config
This is a sample config for BigQuery Usage:
{% codePreview %}
{% codeInfoContainer %}
{% codeInfo srNumber=25 %}
#### Source Configuration - Source Config
You can find all the definitions and types for the `sourceConfig` [here](https://github.com/open-metadata/OpenMetadata/blob/main/openmetadata-spec/src/main/resources/json/schema/metadataIngestion/databaseServiceQueryUsagePipeline.json).
**queryLogDuration**: Configuration to tune how far we want to look back in query logs to process usage data.
{% /codeInfo %}
{% codeInfo srNumber=26 %}
**stageFileLocation**: Temporary file name to store the query logs before processing. Absolute file path required.
{% /codeInfo %}
{% codeInfo srNumber=27 %}
**resultLimit**: Configuration to set the limit for query logs
{% /codeInfo %}
{% codeInfo srNumber=28 %}
**queryLogFilePath**: Configuration to set the file path for query logs
{% /codeInfo %}
{% codeInfo srNumber=29 %}
#### Processor, Stage and Bulk Sink Configuration
To specify where the staging files will be located.
Note that the location is a directory that will be cleaned at the end of the ingestion.