Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
/src/content/docs/registrar/ @dcpena @cloudflare/pcx-technical-writing
/src/content/docs/rules/ @pedrosousa @cloudflare/pcx-technical-writing
/src/content/docs/ruleset-engine/ @pedrosousa @cloudflare/pcx-technical-writing
/src/content/docs/log-explorer/ @angelampcosta @cloudflare/pcx-technical-writing

# Developer Platform

Expand Down
2 changes: 2 additions & 0 deletions public/__redirects
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@
/analytics/graphql-api/tutorials/build-your-own-analytics/ /analytics/graphql-api/tutorials/ 301
/analytics/graphql-api/tutorials/export-graphql-to-csv/ /analytics/graphql-api/tutorials/ 301
/analytics/analytics-integrations/google-cloud/ /analytics/analytics-integrations/ 301
/analytics/dashboards/ /log-explorer/custom-dashboards/ 301

# email-security
/email-security/reporting/search/detection-search/ /email-security/reporting/search/ 301
Expand Down Expand Up @@ -933,6 +934,7 @@
/logs/reference/logpush-api-configuration/filters/ /logs/reference/filters/ 301
# Non-slashed version is being used in the Cloudflare dashboard
/logs/reference/logpush-api-configuration/examples/example-logpush-curl/ /logs/tutorials/examples/example-logpush-curl/ 301
/logs/log-explorer/ /log-explorer/log-search/ 301

# magic-firewall
/magic-firewall/reference/examples/ /magic-firewall/how-to/add-rules/ 301
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
82 changes: 82 additions & 0 deletions src/content/docs/log-explorer/api.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
---
pcx_content_type: reference
title: Log Explorer API
sidebar:
order: 5
---

Configuration and Log searches are also available via a public API.

## Authentication

Log Explorer is available to users with the following permissions:

- **Logs Edit**: users with Logs Edit permissions can enable datasets.
- **Logs Read**: users with Logs Read permissions can run queries via the UI or API.

Note that these permissions exist at the account and zone level and you need the appropriate permission level for the datasets you wish to query.

Authentication with the API can be done via an API token or API key with an email. Refer to [Create API token](/fundamentals/api/get-started/create-token/) for further instructions.

## Query data

Log Explorer includes a SQL API for submitting queries.

For example, to find an HTTP request with a specific [Ray ID](/fundamentals/reference/cloudflare-ray-id/), use the following SQL query:

```bash
curl https://api.cloudflare.com/client/v4/zones/{zone_id}/logs/explorer/query/sql \
--header "Authorization: Bearer <API_TOKEN>" \
--url-query query="SELECT clientRequestScheme, clientRequestHost, clientRequestMethod, edgeResponseStatus, clientRequestUserAgent FROM http_requests WHERE RayID = '806c30a3cec56817' LIMIT 1"
```

This command returns the following HTTP request details:

```json
{
"result": [
{
"clientrequestscheme": "https",
"clientrequesthost": "example.com",
"clientrequestmethod": "GET",
"clientrequestuseragent": "curl/7.88.1",
"edgeresponsestatus": 200
}
],
"success": true,
"errors": [],
"messages": []
}
```

As another example, you could find Cloudflare Access requests with selected columns from a specific timeframe by performing the following SQL query:

```bash
curl https://api.cloudflare.com/client/v4/account/{account_id}/logs/explorer/query/sql \
--header "Authorization: Bearer <API_TOKEN>" \
--url-query query="SELECT CreatedAt, AppDomain, AppUUID, Action, Allowed, Country, RayID, Email, IPAddress, UserUID FROM access_requests WHERE Date >= '2025-02-06' AND Date <= '2025-02-06' AND CreatedAt >= '2025-02-06T12:28:39Z' AND CreatedAt <= '2025-02-06T12:58:39Z'"
```

This command returns the following request details:

```json
{
"result": [
{
"createdat": "2025-01-14T18:17:55Z",
"appdomain": "example.com",
"appuuid": "a66b4ab0-ccdf-4d60-a6d0-54a59a827d92",
"action": "login",
"allowed": true,
"country": "us",
"rayid": "90fbb07c0b316957",
"email": "[email protected]",
"ipaddress": "1.2.3.4",
"useruid": "52859e81-711e-4de0-8b31-283336060e79"
}
],
"success": true,
"errors": [],
"messages": []
}
```
103 changes: 103 additions & 0 deletions src/content/docs/log-explorer/custom-dashboards.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
---
pcx_content_type: reference
title: Custom dashboards
sidebar:
order: 3
---

Custom dashboards allow you to create tailored dashboards to monitor application security, performance, and usage. You can create monitors for ongoing monitoring of a previous incident, use them to identify indicators of suspicious activity, and access templates to help you get started.

:::note
Enterprise customers can create up to 100 dashboards.

Customers on Pro and Business plans can create up to 5 dashboards.
:::

Dashboards provide a visual interface that displays key metrics and analytics, helping you monitor and analyze data efficiently. Different dashboards serve different purposes. For example, a security dashboard tracks attack attempts and threats, a performance dashboard monitors API latency and uptime, and a usage dashboard analyzes traffic patterns and user behavior.

Different metrics serve distinct roles in providing insights into your application's performance. For example, total HTTP requests offer an overview of traffic volume, while average response time helps assess application speed. Additionally, usage metrics such as traffic patterns and user behavior provide insight into how users interact with your application. These metrics together enable you to spot trends, identify problems, and make informed, data-driven decisions.

## Create a new dashboard

To create a new dashboard:

1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/login) and select your account.
2. Go to **Log Explorer** > **Dashboards**.

When creating a dashboard, you have two options: building one from scratch or using a pre-designed template.

- A **templates** provide a faster way to set up a dashboard with commonly used metrics and charts. They are useful for standard use cases, such as monitoring security threats, API performance, or bot traffic. Templates help you get started quickly while still allowing modifications to fit your requirements.
- On the other hand, **from-scratch dashboard** gives you full control over its structure, allowing you to choose the exact datasets, metrics, and visualizations that fit your needs. This approach is ideal if you have specific monitoring goals or need a highly customized view of your data.

Choosing between these options depends on whether you need a quick setup with predefined insights or a fully customized dashboard tailored to your unique analysis needs.

### Create a dashboard from scratch

When creating a dashboard from scratch, select the option **Create new**. You can follow the instructions in the following sections to start adding charts to your dashboard.

#### Create a new chart

To create a new chart, select **Add chart**. There are two ways to create a chart:

- **Use a prompt**: Enter a query like `Compare status code ranges over time.` The AI model decides the most appropriate visualization and constructs your chart configuration.
- **Customize your chart**: Select the chart elements manually, including the chart type, title, dataset to query, metrics, and filters. This option gives you full control over your chart's structure.

Refer to the following sections for more information about the charts, datasets, fields, metrics, and filters available.

##### Chart types

The available chart types include:

- **Timeseries**: Displays trends over time, enabling comparisons across multiple series.
- **Categorical**: Compares proportions across different series.
- **Stat**: Highlights a single value, showing its delta and sparkline for quick insights.
- **Percentage**: Represents one value as a percentage of another.
- **Top N**: Identifies the highest-ranking values for a given attribute.

##### Datasets and metrics

The available metrics and filters vary based on the dataset you want to use. For example, when using the HTTP Requests dataset, you can select **origin response duration** as a metric. You can then choose your preferred aggregation method for that metric, such as total, median, or quantiles. The following table outlines the datasets, fields, and available metrics:


| Dataset | Field | Definition | Metrics |
|-----------------|-----------------|------------|---------|
| HTTP Requests | Requests | The number of requests sent by a client to a server over the HTTP protocol. | Total |
| | DNS Response Time | The time taken for a DNS query to be resolved, measured from when a request is made to when a response is received. | Total, Average, Median, 95th percentile, 99th percentile |
| | Time to First Byte | The duration from when a request is made to when the first byte of the response is received from the server. | Total, Average, Median, 95th percentile, 99th percentile |
| | Bytes returned to the Client | The amount of data (in bytes) sent from the server to the client in response to requests. | Total, Average, Median, 95th percentile, 99th percentile |
| | Number of visits | Unique visits or sessions to a website or application. | Total |
| | Origin response duration | The time taken by the origin server to process and respond to a request. | Total, Average, Median, 95th percentile, 99th percentile |
| Security Events | Security events | Actions taken by Application Security products such as WAF and Bot Management. | Total |

##### Filters

You can also adjust the scope of your analytics by entering filter conditions. This allows you to focus on the most relevant data.

1. Select **Add filter**.
2. Select a **field**, an **operator**, and a **value**. For example, to filter events by source IP address, select the _Source IP_ field, select the _equals_ operator, and enter the IP address.
3. Select **Apply**.

### Create a dashboard from a template

Alternatively, you can choose to create your dashboard using a pre-designed dashboard template. The templates available are:

- **Bot monitoring**: Allows you to identify automated traffic accessing your website.
- **API Security**: Allows you to monitor data transfers and exceptions for API endpoints in your application.
- **Account takeover**: Allows you to monitor login attempts, usage of leaked credentials, and account takeover attacks.
- **API Performance**: Allows you to view timing data for API endpoints in your application, along with error rates.
- **Performance monitoring**: Allows you to identify slow hosts and paths on your origin server, and view time to first byte metrics over time.

Choose one of the templates and select **Use template**.

## Edit a dashboard or chart

After creating your dashboard, to view your saved dashboards, select **Back to all dashboards** to access the full list. Regardless of the way you choose to create your dashboard, you can always edit existing charts and add new ones as needed.

## Further analysis

For each chart, you can:

- Review related traffic in [Security Analytics](/waf/analytics/security-analytics/).
- Explore detailed logs in [Log Explorer](/logs/log-explorer/).

This ensures deeper insights into your application's security, performance, and usage patterns.
49 changes: 49 additions & 0 deletions src/content/docs/log-explorer/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
title: Log Explorer
pcx_content_type: overview
sidebar:
order: 1
---

import { Description, Feature, RelatedProduct } from "~/components"

<Description>
Store and explore your Cloudflare logs directly within the Cloudflare dashboard or API.
</Description>

Log Explorer is Cloudflare's native observability and forensics product that enables security teams and developers to analyze, investigate, and monitor issues directly from the Cloudflare dashboard, without the expense and complexity of forwarding logs to third-party tools.

Log Explorer provides access to Cloudflare logs with all the context available within the Cloudflare platform. You can monitor security and performance issues with custom dashboards or investigate and troubleshoot issues with log search. Benefits include:

- **Reduced cost and complexity**: Drastically reduce the expense and operational overhead associated with forwarding, storing, and analyzing terabytes of log data in external tools.
- **Faster detection and triage**: Access Cloudflare-native logs directly, eliminating cumbersome data pipelines and the ingest lags that delay critical security insights.
- **Accelerated investigations with full context**: Investigate incidents with Cloudflare's unparalleled contextual data, accelerating your analysis and understanding of "What exactly happened?" and "How did it happen?"
- **Minimal recovery time**: Seamlessly transition from investigation to action with direct mitigation capabilities via the Cloudflare platform.

## Features

<Feature header="Log Search" href="/log-explorer/log-search/">
Explore your Cloudflare logs directly within the Cloudflare dashboard or [API](/log-explorer/api/).
</Feature>

<Feature header="Custom dashboards" href="/log-explorer/custom-dashboards/">
Design customized views for tracking application security, performance, and usage metrics.
</Feature>

<Feature header="Manage datasets" href="/log-explorer/manage-datasets/">
Manage the data you want to store within Log Explorer.
</Feature>

<Feature header="API" href= "/log-explorer/api/">
Manage configuration and perform queries via the API.
</Feature>

## Related products

<RelatedProduct header="Logpush" href="/logs/" product="logs">
Forward Cloudflare logs to third-party tools for debugging, identifying configuration adjustments, and creating analytics dashboards.
</RelatedProduct>

<RelatedProduct header="Analytics" href="/analytics/" product="analytics">
Visualize the metadata collected by our products in the Cloudflare dashboard.
</RelatedProduct>
Loading
Loading