diff --git a/blog-service/2026-01-20-collection.md b/blog-service/2026-01-20-collection.md new file mode 100644 index 0000000000..972fdbd60d --- /dev/null +++ b/blog-service/2026-01-20-collection.md @@ -0,0 +1,16 @@ +--- +title: Token-Based Authentication for Secure HTTPS Logs and Metric Source (Collection) +image: https://assets-www.sumologic.com/company-logos/_800x418_crop_center-center_82_none/SumoLogic_Preview_600x600.jpg?mtime=1617040082 +keywords: + - http source + - authentication +hide_table_of_contents: true +--- + +import useBaseUrl from '@docusaurus/useBaseUrl'; + +We're excited to introduce secure token-based authentication for the HTTP Logs and Metrics Source. This new capability allows you to authenticate using a unique token in the request header, maintaining the existing HTTPS endpoint behavior while adding token validation per source. + +Obtain the token to use in an auth header when you configure an HTTP source or regenerate the URL. To learn more, see: +* [Configure an HTTP Logs and Metrics Source](/docs/send-data/hosted-collectors/http-source/logs-metrics/#configure-an-httplogs-and-metrics-source) +* [Generate a New URL for an HTTP Source](/docs/send-data/hosted-collectors/http-source/generate-new-url/) \ No newline at end of file diff --git a/cid-redirects.json b/cid-redirects.json index 4ca0263582..8ee71075b3 100644 --- a/cid-redirects.json +++ b/cid-redirects.json @@ -341,6 +341,7 @@ "/03Send-Data/Sources/02Sources-for-Hosted-Collectors/HTTP-Source-Overview/Configure-an-HTTP-Source-for-API-Access": "/docs/send-data/hosted-collectors/http-source", "/docs/send-data/hosted-collectors/http-source/upload-metrics": "/docs/send-data/hosted-collectors/http-source/logs-metrics/upload-metrics", "/docs/send-data/hosted-collectors/http-source/upload-logs": "/docs/send-data/hosted-collectors/http-source/logs-metrics/upload-logs", + "/docs/send-data/hosted-collectors/http-source/generate-new-url-with-auth-header": "/docs/send-data/hosted-collectors/http-source/generate-new-url", "/03Send-Data/Sources/02Sources-for-Hosted-Collectors/HTTP-Source/Upload-Metrics-to-an-HTTP-Source/Types_of_Prometheus_Metrics_not_Accepted_by_Sumo": "/docs/send-data/hosted-collectors/http-source/logs-metrics/upload-metrics", "/03Send-Data/Sources/02Sources-for-Hosted-Collectors/HTTP-Source/Troubleshooting-HTTP-Sources": "/docs/send-data/hosted-collectors/http-source/troubleshooting", "/03Send-Data/Sources/02Sources-for-Hosted-Collectors/HTTP-Source/zGenerate-a-new-URL-for-an-HTTP-Source": "/docs/send-data/hosted-collectors/http-source/generate-new-url", diff --git a/docs/send-data/hosted-collectors/http-source/generate-new-url-with-auth-header.md b/docs/send-data/hosted-collectors/http-source/generate-new-url-with-auth-header.md deleted file mode 100644 index 96ef66f8a2..0000000000 --- a/docs/send-data/hosted-collectors/http-source/generate-new-url-with-auth-header.md +++ /dev/null @@ -1,202 +0,0 @@ ---- -id: generate-new-url-with-auth-header -title: Generate a New URL for an HTTP Source with an Auth Header -sidebar_label: Regenerate URL ---- - -import useBaseUrl from '@docusaurus/useBaseUrl'; - - - - - -

Beta

- -Sumo Logic offers secure token-based authentication for the HTTPS Logs and Metrics Source. This capability allows you to authenticate using a unique token in the request header, maintaining the existing HTTPS endpoint behavior while adding token validation per source. Obtain the token to use in an auth header when you configure an HTTP source or regenerate the URL. - -## Generate a new URL for an HTTP source - -You can generate a new URL for an HTTP Source at any time. Generating a new URL completely invalidates the old URL. - -To generate a new URL: - -1. [**New UI**](/docs/get-started/sumo-logic-ui). In the Sumo Logic main menu select **Data Management**, and then under **Data Collection** select **Collection**. You can also click the **Go To...** menu at the top of the screen and select **Collection**.  
[**Classic UI**](/docs/get-started/sumo-logic-ui-classic). In the main Sumo Logic menu, select **Manage Data > Collection > Collection**. -1. On the **Manage Collection** page, click **Regenerate URL** next to the HTTP source.
Regenerate URL link -1. In the **HTTP Source Address** dialog box, select one of the following to regenerate the URL where the source data will be stored: - * **Presigned URL**. Select to copy a presigned URL with embedded authentication.
Generate New URL - * **Auth Header**. Select to copy the URL, as well as a separate authorization header that contains an authentication token. This option provides greater security than a presigned URL because placing the authentication token in the authorization header of a request prevents the token from being exposed in the URL.
Generate New URL and token -1. Click **Generate**. -1. When asked to confirm the generation, click **OK**. -1. In the resulting dialog box, the newly-generated URL is displayed, as well as the authorization header if you selected **Auth Header**. Copy the URL (and header if applicable) and keep in a safe place. -1. Use the copied URL (and header if appropriate) when you [upload data to your HTTP Logs and Metrics source](/docs/send-data/hosted-collectors/http-source/logs-metrics/#upload-data-to-the-httplogs-and-metrics-source). - -:::note -If you see a 401 (failed to authenticate) error message right after generating a new URL, wait a few minutes, then try the new URL again. -::: - -## Upload logs to an HTTP source - - - -### Upload log data with a POST request - -When you [upload log with a POST request](/docs/send-data/hosted-collectors/http-source/logs-metrics/upload-logs/#upload-log-data-with-a-post-request), keep in mind the following. - -To upload log data with a POST request, include the complete data payload as the request body. Any query parameters will be ignored. - -:::important -We recommend that the POST data payload have a size, before compression, of 100KB to 1MB. See [data payload considerations](/docs/send-data/hosted-collectors/http-source/logs-metrics/#data-payload-considerations) for details. -::: - -* Data payload: - * Data line 1 - * Data line 2 - * Data line 3 -* Method: POST -* URL:
Enter the URL obtained when you configure the HTTP Logs and Metrics Source or when you regenerate the URL. Enter either a presigned URL or a URL to be used with an auth header: - * Presigned URL: `https://[SumoEndpoint]/receiver/v1/http/[UniqueHTTPCollectorCode]`
where - * [SumoEndpoint] is your Sumo collection endpoint - * [UniqueHTTPCollectorCode] is the string that follows the last forward slash (`/`) in the upload URL for the HTTP source - * URL used with auth header: `https://[SumoEndpoint]/receiver/v1/http`
where [SumoEndpoint] is your Sumo collection endpoint -* Body - * Data line 1 - * Data line 2 - * Data line 3 - -### Supported HTTP Headers - -The following parameters can be specified via headers when sending data to an HTTP Source. The settings will apply to all messages in the request. For Source Name, Host, and Category, the header value will override any default value already specified for the source and/or collector. - -You can configure your Source to process HTTP Headers into metadata fields. See [HTTP Source fields](/docs/manage/fields) for details. - -:::note -Overridden metadata field values are not returned with [Search Autocomplete](/docs/search/get-started-with-search/search-basics/search-autocomplete). -::: - -| Setting | Header Name | Header Value | -|:--|:--|:--| -| Compressed data | `Content-Encoding` | Values can be `zstd`, `gzip`, or `deflate`.
Required if you are uploading compressed data. | -| Custom Source Name | `X-Sumo-Name` | Desired source name.
Useful if you want to override the source name configured for the source. | -| Custom Source Host | `X-Sumo-Host` | Desired host name.
Useful if you want to override the source host configured for the source. | -| Custom Source Category | `X-Sumo-Category` | Desired source category.
Useful if you want to override the source category configured for the source. | -| Fields as custom metadata | `X-Sumo-Fields` | [Fields](/docs/manage/fields) need to be in a comma separated list of key-value pairs. | -| Token authentication | `x-sumo-token` | Token to be used for authentication in an authorization header. Obtain the token when you select **Auth Header** when you [configure the HTTP Logs and Metrics Source](/docs/send-data/hosted-collectors/http-source/logs-metrics/#configure-an-httplogs-and-metrics-source), or when you [regenerate the URL](/docs/send-data/hosted-collectors/http-source/generate-new-url/). | - -### Command line examples - -:::note -Data is ingested according to the configured [processing rules](/docs/send-data/collection/processing-rules). Messages blocked by filters will not be ingested. -::: - -#### cURL - -When using cURL to POST data from a file:  - -* Make sure to use the -T parameter to specify the file path, not -d. The -d parameter causes new lines to be removed from the content, which will interfere with message boundary detection. -* Make sure that each line in the file follows the format specified by the Content-Type header for the HTTP request. -* Enter the URL (and auth header if applicable) obtained when you [configured the HTTP Logs and Metrics Source](/docs/send-data/hosted-collectors/http-source/logs-metrics/#configure-an-httplogs-and-metrics-source) or when you [regenerate the URL](/docs/send-data/hosted-collectors/http-source/generate-new-url/). If you use an auth header, enter it in this format:
`-H "x-sumo-token: [TokenString]"` - -**POST upload** - -Presigned URL: -```bash -curl -v -X POST -T [local_file_name] https://collectors.sumologic.com/receiver/v1/http/[UniqueHTTPCollectorCode] -``` -URL with auth header: -```bash -curl -v -X POST -H "x-sumo-token: [TokenString]" -T [local_file_name] https://collectors.sumologic.com/receiver/v1/http -``` - -**POST upload (gzip compressed data)**  - -Presigned URL: -```bash -curl -v -X POST -H 'Content-Encoding:gzip' -T [local_file_name.gz] https://collectors.sumologic.com/receiver/v1/http/[UniqueHTTPCollectorCode] -``` - -URL with auth header: -```bash -curl -v -X POST -H 'Content-Encoding:gzip' -H "x-sumo-token: [TokenString]" -T [local_file_name.gz] https://collectors.sumologic.com/receiver/v1/http -``` - -**POST upload with custom Source Category** - -Presigned URL: -```bash -curl -v -X POST -H 'X-Sumo-Category:myNewCategory' -T [local_file_name] https://collectors.sumologic.com/receiver/v1/http/[UniqueHTTPCollectorCode] -``` - -URL with auth header: -```bash -curl -v -X POST -H 'X-Sumo-Category:myNewCategory' -H "x-sumo-token: [TokenString]" -T [local_file_name] https://collectors.sumologic.com/receiver/v1/http -``` - -**POST upload with custom Fields** - -Presigned URL: -```bash -curl -v -X POST -H 'X-Sumo-Fields:environment=dev,cluster=k8s' -T [local_file_name] https://collectors.sumologic.com/receiver/v1/http/[UniqueHTTPCollectorCode] -``` -URL with auth header: -```bash -curl -v -X POST -H 'X-Sumo-Fields:environment=dev,cluster=k8s' -H "x-sumo-token: [TokenString]" -T [local_file_name] https://collectors.sumologic.com/receiver/v1/http -``` - -#### PowerShell - -**POST upload** - -In the following examples when a URL is used with an auth header, `$headers` is defined as follows: - -```bash -$headers = @{ - Authorization="x-sumo-token: [TokenString]" - Content='application/json' -} -``` - -Presigned URL: -```bash -Invoke-WebRequest -Method POST -InFile [local_file_name] 'https://collectors.sumologic.com/receiver/v1/http/[UniqueHTTPCollectorCode]' -``` - -URL with auth header: -```bash -Invoke-WebRequest -Method POST -InFile [local_file_name] 'https://collectors.sumologic.com/receiver/v1/http' -Headers $headers -``` - -**POST upload (gzip compressed data)**  - -Presigned URL: -```bash -Invoke-WebRequest -Method POST -Headers @{'Content-Encoding' = 'gzip'} -InFile [local_file_name.gz] 'https://collectors.sumologic.com/receiver/v1/http/[UniqueHTTPCollectorCode]' -``` - -URL with auth header: -```bash -Invoke-WebRequest -Method POST -Headers @{'Content-Encoding' = 'gzip'} -InFile [local_file_name.gz] 'https://collectors.sumologic.com/receiver/v1/http' -Headers $headers -``` - -**POST upload with custom Source Category** - -Presigned URL: -```bash -Invoke-WebRequest -Method POST -Headers @{'X-Sumo-Category' = 'myCustomCategory'} -InFile [local_file_name] 'https://collectors.sumologic.com/receiver/v1/http/[UniqueHTTPCollectorCode]' -``` - -URL with auth header: -```bash -Invoke-WebRequest -Method POST -Headers @{'X-Sumo-Category' = 'myCustomCategory'} -InFile [local_file_name] 'https://collectors.sumologic.com/receiver/v1/http' -Headers $headers -``` - -**POST upload with custom Field** - -Presigned URL: -```bash -Invoke-WebRequest -Method POST -Headers @{'X-Sumo-Fields' = 'environment=dev'} -InFile [local_file_name] 'https://collectors.sumologic.com/receiver/v1/http/[UniqueHTTPCollectorCode]' -``` - -URL with auth header: -```bash -Invoke-WebRequest -Method POST -Headers @{'X-Sumo-Fields' = 'environment=dev'} -InFile [local_file_name] 'https://collectors.sumologic.com/receiver/v1/http' -Headers $headers -``` diff --git a/docs/send-data/hosted-collectors/http-source/generate-new-url.md b/docs/send-data/hosted-collectors/http-source/generate-new-url.md index eec02afb0f..d5652324aa 100644 --- a/docs/send-data/hosted-collectors/http-source/generate-new-url.md +++ b/docs/send-data/hosted-collectors/http-source/generate-new-url.md @@ -6,22 +6,6 @@ sidebar_label: Regenerate URL import useBaseUrl from '@docusaurus/useBaseUrl'; -You can generate a new URL for an HTTP Source at any time. Generating a new URL completely invalidates the old URL. - -To generate a new URL: - -1. [**New UI**](/docs/get-started/sumo-logic-ui). In the Sumo Logic main menu select **Data Management**, and then under **Data Collection** select **Collection**. You can also click the **Go To...** menu at the top of the screen and select **Collection**.  
[**Classic UI**](/docs/get-started/sumo-logic-ui-classic). In the main Sumo Logic menu, select **Manage Data > Collection > Collection**. -1. On the **Manage Collection** page, click **Regenerate URL** next to the HTTP source.
Regenerate URL link -1. In the **HTTP Source Address** dialog box, click **Generate**.
http_source_dialog_generate.png -1. When asked to confirm the generation, click **OK**. -1. In the **HTTP Source Address** dialog box, the new URL is displayed. Copy and paste the URL, then click **OK**.
http_source_dialog_generate.png - -:::note -If you see a 401 (failed to authenticate) error message right after generating a new URL, wait a few minutes, then try the new URL again. -::: - - \ No newline at end of file diff --git a/docs/send-data/hosted-collectors/http-source/logs-metrics/index.md b/docs/send-data/hosted-collectors/http-source/logs-metrics/index.md index 3cf5fe4754..d38cf97b95 100644 --- a/docs/send-data/hosted-collectors/http-source/logs-metrics/index.md +++ b/docs/send-data/hosted-collectors/http-source/logs-metrics/index.md @@ -53,15 +53,11 @@ To configure an HTTP Logs and Metrics Source: * **One Message Per Request.** Select this option if you'll be sending a single message with each HTTP request. For more information, see [Multiline options in HTTP sources](#multiline-options-in-http-sources).  1. **Processing Rules.** Configure any desired filters, such as allowlist, denylist, hash, or mask, as described in Create a Processing Rule. Processing rules are applied to log data, but not to metric data. 1. When you are finished configuring the Source, click **Save**. -1. When the URL associated with the source is displayed, copy the URL so you can use it to upload data.
HTTP Source Address dialog - - :::note * Metrics reported with a timestamp older than 24 hours ago or newer than 24 hours in the future from the time they are reported are dropped. Make sure that the Metrics sent to HTTP Endpoint have appropriate timestamps. diff --git a/docs/send-data/hosted-collectors/http-source/logs-metrics/upload-logs.md b/docs/send-data/hosted-collectors/http-source/logs-metrics/upload-logs.md index 8f0351de58..d39a51cd97 100644 --- a/docs/send-data/hosted-collectors/http-source/logs-metrics/upload-logs.md +++ b/docs/send-data/hosted-collectors/http-source/logs-metrics/upload-logs.md @@ -29,21 +29,15 @@ We recommend that the POST data payload have a size, before compression, of 100K * Data line 2 * Data line 3 * Method: POST -* URL: `https://[SumoEndpoint]/receiver/v1/http/[UniqueHTTPCollectorCode]` where - * [SumoEndpoint] is your Sumo collection endpoint - * [UniqueHTTPCollectorCode] is the string that follows the last forward slash (`/`) in the upload URL for the HTTP source -* Body - * Data line 1 - * Data line 2 - * Data line 3 - - +* Body + * Data line 1 + * Data line 2 + * Data line 3 ## Supported HTTP Headers @@ -62,10 +56,7 @@ Overridden metadata field values are not returned with [Search Autocomplete](/do | Custom Source Host | `X-Sumo-Host` | Desired host name.
Useful if you want to override the source host configured for the source. | | Custom Source Category | `X-Sumo-Category` | Desired source category.
Useful if you want to override the source category configured for the source. | | Fields as custom metadata | `X-Sumo-Fields` | [Fields](/docs/manage/fields) need to be in a comma separated list of key-value pairs. | - - ## Command line examples @@ -77,65 +68,6 @@ Data is ingested according to the configured [processing rules](/docs/send-dat When using cURL to POST data from a file:  -* Make sure to use the -T parameter to specify the file path, not -d. The -d parameter causes new lines to be removed from the content, which will interfere with message boundary detection. -* Make sure that each line in the file follows the format specified by the Content-Type header for the HTTP request. - -**POST upload** - -```bash -curl -v -X POST -T [local_file_name] https://collectors.sumologic.com/receiver/v1/http/[UniqueHTTPCollectorCode] -``` - -**POST upload (gzip compressed data)**  - -```bash -curl -v -X POST -H 'Content-Encoding:gzip' -T [local_file_name.gz] https://collectors.sumologic.com/receiver/v1/http/[UniqueHTTPCollectorCode] -``` - -**POST upload with custom Source Category** - -```bash -curl -v -X POST -H 'X-Sumo-Category:myNewCategory' -T [local_file_name] https://collectors.sumologic.com/receiver/v1/http/[UniqueHTTPCollectorCode] -``` - -**POST upload with custom Fields** - -```bash -curl -v -X POST -H 'X-Sumo-Fields:environment=dev,cluster=k8s' -T [local_file_name] https://collectors.sumologic.com/receiver/v1/http/[UniqueHTTPCollectorCode] -``` - -### PowerShell - -**POST upload** - -```bash -Invoke-WebRequest -Method POST -InFile [local_file_name] 'https://collectors.sumologic.com/receiver/v1/http/[UniqueHTTPCollectorCode]' -``` - -**POST upload (gzip compressed data)**  - -```bash -Invoke-WebRequest -Method POST -Headers @{'Content-Encoding' = 'gzip'} -InFile [local_file_name.gz] 'https://collectors.sumologic.com/receiver/v1/http/[UniqueHTTPCollectorCode]' -``` - -**POST upload with custom Source Category** - -```bash -Invoke-WebRequest -Method POST -Headers @{'X-Sumo-Category' = 'myCustomCategory'} -InFile [local_file_name] 'https://collectors.sumologic.com/receiver/v1/http/[UniqueHTTPCollectorCode]' -``` - -**POST upload with custom Field** - -```bash -Invoke-WebRequest -Method POST -Headers @{'X-Sumo-Fields' = 'environment=dev'} -InFile [local_file_name] 'https://collectors.sumologic.com/receiver/v1/http/[UniqueHTTPCollectorCode]' -``` - - \ No newline at end of file diff --git a/docs/send-data/hosted-collectors/http-source/logs-metrics/upload-metrics.md b/docs/send-data/hosted-collectors/http-source/logs-metrics/upload-metrics.md index 5806d97753..1ebf63c590 100644 --- a/docs/send-data/hosted-collectors/http-source/logs-metrics/upload-metrics.md +++ b/docs/send-data/hosted-collectors/http-source/logs-metrics/upload-metrics.md @@ -93,10 +93,7 @@ Overridden metadata field values are not returned with [Search Autocomplete](/do | Custom Source Category | `X-Sumo-Category` | Desired source category.
Useful if you want to override the source category configured for the source. | | Custom Metric Dimensions | `X-Sumo-Dimensions` | Comma-separated key=value list of dimensions to apply to every metric.
For metrics only. Custom dimensions will allow you to query your metrics at a more granular level. | | Custom Metric Metadata | `X-Sumo-Metadata` | Comma-separated, key=value list of metadata to apply to every metric.
For metrics only. Custom metadata will allow you to query your metrics at a more granular level. | - - ## Data volume and metadata limits for metrics @@ -158,66 +155,6 @@ URL with auth header: curl -v -X POST -H 'Content-Type:application/vnd.sumologic.prometheus' -H "x-sumo-token: [TokenString]" -T [local_file_name] http://collectors.sumologic.com/receiver/v1/http ``` - - ## Prometheus Metrics Not Accepted by Sumo By design, Sumo does not ingest Prometheus comments. Sumo also rejects Prometheus metrics that do not conform to the Prometheus metric format. This page lists the conditions that will cause Sumo to reject Prometheus metrics