> ## 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.

# Route logs from Logstash

> Learn how to route logs from Logstash to Palo Alto Networks Cortex XCOR.

You can route log data from Logstash to Palo Alto Networks Cortex XCOR. To route
logs, configure an
[HTTP output plugin](https://www.elastic.co/guide/en/logstash/current/plugins-outputs-http.html)
in your
[Logstash pipeline configuration file](https://www.elastic.co/guide/en/logstash/current/config-setting-files.html)
that specifies your Cortex XCOR tenant as a destination.

1. In your Logstash pipeline configuration file, add an `output` section that defines
   the `http` plugin:

   ```text theme={null}
   output {
     http {
        http_method=>"post"
        headers => {
            "Content-Type" => "application/json"
            "API-token" => "API_TOKEN"
        }
        url=>"https://TENANT.chronosphere.io/api/v1/data/logs/ingest"
        format=>"json_batch"
     }
   }
   ```

   * Replace *`API_TOKEN`* with the API token generated from your [service account](https://docs-xcor.paloaltonetworks.com/administer/accounts-teams/service-accounts.md). Cortex XCOR recommends storing your API token in a separate file or Kubernetes Secret and calling it using an environment variable, such as `$API_TOKEN`.

     > [!NOTE]
     >
     > The service account must have read access to route log data to Cortex XCOR.

   * Replace *`TENANT`* with the name of your Cortex XCOR tenant.

   * Optional: The `format=>"json_batch"` option collects each batch of events
     received by the output and places them into a single JSON array that's sent in
     one request.

2. After defining the output, [contact Cortex XCOR Support](https://docs-xcor.paloaltonetworks.com/support.md) and indicate
   which field in your data contains log timestamps.


## Related topics

- [Ingest log data](https://docs-xcor.paloaltonetworks.com/ingest/logs.md)
- [Integrate with Cortex XCOR](https://docs-xcor.paloaltonetworks.com/integrate.md)
- [Route logs from Fluent Bit](https://docs-xcor.paloaltonetworks.com/ingest/logs/fluentbit-logs.md)
- [Route logs over HTTP](https://docs-xcor.paloaltonetworks.com/ingest/logs/http-logs.md)
- [Route logs from Google Cloud Platform](https://docs-xcor.paloaltonetworks.com/ingest/logs/gcp-logs.md)


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