> ## Documentation Index
> Fetch the complete documentation index at: https://docs-xcor.paloaltonetworks.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Import Grafana dashboards

> Import dashboards exported from Grafana 7.5 or earlier into Palo Alto Networks Cortex XCOR as classic dashboards.

You can export dashboards from Grafana as JSON, then import them into Palo Alto
Networks Cortex XCOR as [classic dashboards](/observe/dashboards/classic-dashboards)
or convert them directly into
[standard dashboards](/observe/dashboards/classic-dashboards/migrate-to-standard) with the
Config API. For steps on exporting a dashboard from Grafana, see its
[documentation](https://grafana.com/docs/grafana/v7.5/dashboards/export-import/).

<Warning>
  Classic dashboard API endpoints are not available for organizations on standard
  dashboards. Requests to these endpoints return an error. To manage dashboards
  programmatically in these environments, use the
  [standard dashboard](/observe/dashboards) endpoints. For information
  about your organization's dashboard configuration, contact
  [Cortex XCOR Support](/support).
</Warning>

<Warning>
  Cortex XCOR supports dashboards exported from Grafana versions up to 7.5. Dashboards
  exported from newer versions of Grafana might not be importable without modification.
</Warning>

<Tabs>
  <Tab title="Web" id="import-a-grafana-dashboard-web">
    To import a Grafana dashboard in the Cortex XCOR interface, see
    [import a dashboard](/observe/dashboards#import-a-dashboard-with-json).
  </Tab>

  <Tab title="Chronoctl" id="import-a-grafana-dashboard-chronoctl">
    <Note>
      You need Chronoctl installed and configured. Read the
      [Chronoctl documentation](/tooling/chronoctl) for more details.
    </Note>

    1. From a directory of Grafana dashboard JSON files, run `chronoctl convert grafana`
       to write [Chronoctl](/tooling/chronoctl) YAML to a file:

       ```shell theme={null}
       chronoctl convert grafana -D <DIRECTORY> > <DASHBOARDS FILE.YML>
       ```

       Replace *`DIRECTORY`* with the path that contains the JSON files, and replace
       *`DASHBOARDS FILE.YML`* with the output filename.
    2. Optional: Add the `--graphite-datasource` option to the `convert grafana` command
       for dashboards that use a Graphite data source.
    3. Apply the YAML to import the dashboards:

       ```shell theme={null}
       chronoctl apply -f DASHBOARDS FILE.YML
       ```

       Replace *`DASHBOARDS FILE.YML`* with the same output filename you used with
       `convert grafana`.
  </Tab>

  <Tab title="Terraform" id="import-a-grafana-dashboard-terraform">
    To import a Grafana dashboard using [Terraform](/tooling/infrastructure/terraform):

    1. Declare a `chronosphere_classic_dashboard` resource in a Terraform file and provide
       a resource name.

       For example, the following code creates a dashboard that Terraform refers to as
       `kubelet` and Cortex XCOR associates with a specific collection:

       ```terraform Terraform example icon="square-terminal" theme={null}
       resource "chronosphere_classic_dashboard" "kubelet" {
         # Reference to the collection to which the alert belongs
         collection_id = chronosphere_collection.service.id

         # Inlined Grafana dashboard JSON. Note the inlined service_name variable in the definition
         dashboard_json = <<EOF
       {
         "title": "${var.service_name} Overview",
         // ...
       }
       EOF
       }
       ```
    2. Add the [Grafana dashboard JSON](https://grafana.com/docs/grafana/v7.5/dashboards/export-import/)
       inline as the content of the `dashboard_json` field. If the Grafana dashboard sets
       the `uid` field, the Terraform provider ignores it and assigns a unique identifier.
    3. Use `terraform apply` to apply the Terraform file and create the resource.
  </Tab>

  <Tab title="API" id="import-a-grafana-dashboard-api">
    To import Grafana dashboard JSON as a standard dashboard, call
    [`ImportDashboardFromClassic`](/tooling/api-info/definition/operations/ImportDashboardFromClassic).
    Pass the exported JSON as `classic_dashboard_json`.

    For request fields, a dry-run workflow, and example request and response bodies,
    see [Migrate to standard dashboards](/observe/dashboards/classic-dashboards/migrate-to-standard).
  </Tab>
</Tabs>


## Related topics

- [Migrate classic dashboards to standard dashboards](/observe/dashboards/classic-dashboards/migrate-to-standard.md)
- [Visualize data using dashboards](/observe/dashboards.md)
- [CreateGrafanaDashboard](/tooling/api-info/definition/operations/CreateGrafanaDashboard.md)
- [UpdateGrafanaDashboard](/tooling/api-info/definition/operations/UpdateGrafanaDashboard.md)
- [ReadGrafanaDashboard](/tooling/api-info/definition/operations/ReadGrafanaDashboard.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.