Validate Cloud Logs Export Data
Cloud Logs Export validates your data before making it available, but it can also be inspected and validated by you
through the lokitool command line interface.
To validate you have to know which index you’d like to validate. In case you don’t know where to start:
- In Grafana Cloud, select Explore from the main menu.
- On the Explore page, set the data source to the one that starts with
insightlogs. - Search for
index successfully auditedin the logs. You’ll see log lines that contains anindexfield. - Pick one of the listed indexes. This is the index you’ll validate in the next steps.
For this example the selected index is
index/my_loki_index_19856/12345/1715707992713992005-compactor-1715189977885-1715707796275-f8003361.tsdb.gz.
With the desired index in hand, you now:
Download the
lokitoolfrom the Releases page that matches your Loki version.Create a YAML configuration with the structure shown below. The
schema_configandstorage_configcan be the same you have used previously to query CLE data. In this example this file is namedcle-config.yaml.schema_config: configs: - from: '2023-08-21' index: period: 24h prefix: my_index_ #Replace with the index value you are validating object_store: gcs schema: v13 store: tsdb storage_config: gcs: bucket_name: my-loki-bucket tenant: <your Grafana Cloud Logs tenant ID> #Replace with your tenant IDIf you do not know your Grafana Cloud Logs tenant ID:
- Navigate to your Cloud Portal Overview page.
- Click Details for your stack.
- On the Loki tile, click Details.
- Under Grafana Data Source Settings copy the value from the User field. This is your Grafana Cloud Logs tenant ID.
Run the downloaded
lokitoolbinary the following way:./lokitool-linux-amd64 audit index --config.file=deprecated --index.file=index/my_loki_index_19856/12345/1715707992713992005-compactor-1715189977885-1715707796275-f8003361.tsdb.gz -- --period=19856 --config.file=cle-config.yaml- The
--periodconfiguration represents the period of the index being audited. You can find it by checking the 5-digits number appended as a suffix of the Loki environment name in the index file. For example: Forindex/loki_env_tsdb_index_19856/12345/..., the period is19856. - The
--config.fileis the YAML configuration file created by you in the second step. Notice that the first appearance of this configuration is before the isolated--symbol and is deprecated (to be removed on the next major); what really counts is the second appearance, after the isolated--symbol. - The
--index.fileis the path to the index file you want to audit. You can look at your bucket to see the exactly path of an index you’d like to validate.
- The
Review the results. If any error shows up make sure to report it to Grafana Cloud Logs support.



