You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
--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'"
Log Search is available to users with the following permissions:
74
+
75
+
-**Logs Edit**: users with Logs Edit permissions can enable datasets.
76
+
-**Logs Read**: users with Logs Read permissions can run queries via the UI or API.
77
+
78
+
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.
79
+
80
+
Authentication with the API can be done via an authentication header or API token. Append your API call with either of the following additional parameters.
81
+
82
+
-**Authentication header**
83
+
84
+
-`X-Auth-Email` - the Cloudflare account email address associated with the domain
85
+
-`X-Auth-Key` - the Cloudflare API key
86
+
87
+
-**API token**
88
+
89
+
-`Authorization: Bearer <API_TOKEN>` To create an appropriately scoped API token, refer to [Create API token](/fundamentals/api/get-started/create-token/) documentation. Copy and paste the token into the authorization parameter for your API call.
Copy file name to clipboardExpand all lines: src/content/docs/log-explorer/custom-dashboards.mdx
+6-5Lines changed: 6 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,14 +7,15 @@ sidebar:
7
7
8
8
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.
9
9
10
-
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.
11
-
12
-
Different metrics serve distinct roles in providing insights into your application's performance. For example, total HTTP requests offers 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.
13
-
14
10
:::note
15
-
Custom dashboards is currently available to customers participating in the Log Explorer beta. To begin using custom dashboards, you will first need to request access to [Log Explorer](/logs/log-explorer/).
11
+
Enterprise customers can create up to 100 dashboards.
12
+
Customers on Pro and Business plans can create up to 5 dashboards.
16
13
:::
17
14
15
+
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.
16
+
17
+
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.
Detailed logs that contain metadata generated by Cloudflare products helpful for debugging, identifying configuration adjustments, and creating analytics.
Log Search is available to users with the following permissions:
26
-
27
-
-**Logs Edit**: users with Logs Edit permissions can enable datasets.
28
-
-**Logs Read**: users with Logs Read permissions can run queries via the UI or API.
29
-
30
-
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.
31
-
32
-
Authentication with the API can be done via an authentication header or API token. Append your API call with either of the following additional parameters.
33
-
34
-
-**Authentication header**
35
-
36
-
-`X-Auth-Email` - the Cloudflare account email address associated with the domain
37
-
-`X-Auth-Key` - the Cloudflare API key
38
-
39
-
-**API token**
40
-
41
-
-`Authorization: Bearer <API_TOKEN>` To create an appropriately scoped API token, refer to [Create API token](/fundamentals/api/get-started/create-token/) documentation. Copy and paste the token into the authorization parameter for your API call.
42
-
43
-
## Enable Log Explorer
44
-
45
-
In order for Log Explorer to begin storing logs, you need to enable the desired datasets. You can do this via the dashboard or the API.
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/login) and select your account or domain (also known).
50
-
2. Go to **Log Explorer** > **Manage datasets**.
51
-
3. Select **Add dataset** to select the datasets you want to query.
52
-
4. Choose a dataset and then a zone. Then, select **Add**. You can always return to this page to enable more datasets or manage your existing ones.
53
-
54
-
:::note
55
-
It may take a few minutes for the logs to become available for querying.
56
-
:::
57
-
58
-
</TabItem> <TabItemlabel="API">
59
-
60
-
Use the Log Explorer API to enable Log Explorer for each dataset you wish to store. It may take a few minutes after a log stream is enabled before you can view the logs.
61
-
62
-
The following curl command is an example for enabling the zone-level dataset `http_requests`, as well as the expected response when the command succeeds.
You can filter and view your logs via the Cloudflare dashboard or the API.
109
22
110
23
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/login) and select your account.
111
24
2. Go to **Log Explorer** > **Log Search**.
@@ -117,88 +30,70 @@ Filtering and viewing your logs is available via the Cloudflare Dashboard or via
117
30
8. Select **Run query** when you are done. The results are displayed below within the **Query results** section.
118
31
119
32
:::note
120
-
121
33
You can also access the Log Explorer dashboard directly from the [Security Analytics dashboard](/waf/analytics/security-analytics/#logs). When doing so, the filters you applied in Security Analytics will automatically carry over to your query in Log Explorer.
122
-
123
34
:::
124
35
125
-
</TabItem> <TabItemlabel="API">
126
-
127
-
Log Explorer exposes a query endpoint that uses a familiar SQL syntax for querying your logs generated with Cloudflare's network.
128
-
129
-
For example, to find an HTTP request with a specific [Ray ID](/fundamentals/reference/cloudflare-ray-id/), you can perform the following SQL query:
--url-query query="SELECT clientRequestScheme, clientRequestHost, clientRequestMethod, edgeResponseStatus, clientRequestUserAgent FROM http_requests WHERE RayID = '806c30a3cec56817' LIMIT 1"
135
-
```
136
-
137
-
Which returns the following HTTP request details:
138
-
139
-
```json
140
-
{
141
-
"result": [
142
-
{
143
-
"clientrequestscheme": "https",
144
-
"clientrequesthost": "example.com",
145
-
"clientrequestmethod": "GET",
146
-
"clientrequestuseragent": "curl/7.88.1",
147
-
"edgeresponsestatus": 200
148
-
}
149
-
],
150
-
"success": true,
151
-
"errors": [],
152
-
"messages": []
153
-
}
36
+
For example, to find an HTTP request with a specific [Ray ID](/fundamentals/reference/cloudflare-ray-id/), go to **Custom SQL**, and enter the following SQL query:
37
+
38
+
```sql
39
+
SELECT
40
+
clientRequestScheme,
41
+
clientRequestHost,
42
+
clientRequestMethod,
43
+
edgeResponseStatus,
44
+
clientRequestUserAgent
45
+
FROM http_requests
46
+
WHERE RayID ='806c30a3cec56817'
47
+
LIMIT1
154
48
```
155
49
156
-
For another example using an account-level dataset, to find Cloudflare Access requests with selected columns from a specific timeframe, you can perform the following SQL query:
--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'"
After selecting all the fields for your query, you can save it by selecting **Save query**. Provide a name and description to help identify it later. To view your saved and recent queries, select **Queries** — they will appear in a side panel where you can insert a new query, or delete any query.
193
71
194
72
## Optimize your queries
195
73
196
-
All the tables supported by Log Explorer contain a special column called `date`, which helps to narrow down the amount of data that is scanned to respond to your query, resulting in faster query response times. The value of `date` must be in the form of `YYYY-MM-DD`. For example, to query logs that occurred on October 12, 2023, add the following to your `WHERE` clause: `date = '2023-10-12'`. The column supports the standard operators of `<`, `>`, and `=`:
74
+
All the tables supported by Log Explorer contain a special column called `date`, which helps to narrow down the amount of data that is scanned to respond to your query, resulting in faster query response times. The value of `date` must be in the form of `YYYY-MM-DD`. For example, to query logs that occurred on October 12, 2023, add the following to your `WHERE` clause: `date = '2023-10-12'`. The column supports the standard operators of `<`, `>`, and `=`.
0 commit comments