Skip to content

Commit 86bee7c

Browse files
Add InfluxDB 3 query guides (#5798)
* base content for influxdb3 query guides * added enterprise versions of query guides * Apply suggestions from code review Co-authored-by: Jason Stirnaman <jstirnaman@influxdata.com> * update template titles to use .RenderString --------- Co-authored-by: Jason Stirnaman <jstirnaman@influxdata.com>
1 parent 824b2f8 commit 86bee7c

File tree

84 files changed

+4564
-97
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+4564
-97
lines changed

assets/js/custom-timestamps.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ function updateTimestamps (newStartDate) {
131131
oldDatePart = datePart(x.rfc3339.replace(/T.*$/, ''));
132132
newDatePart = datePart(x.rfc3339_new.replace(/T.*$/, ''));
133133
rfc3339Regex = new RegExp(
134-
`${oldDatePart.year}(.*)${oldDatePart.month}(.*)${oldDatePart.day}`,
134+
`${oldDatePart.year}(.*?)${oldDatePart.month}(.*?)${oldDatePart.day}`,
135135
'g'
136136
);
137137
rfc3339Repl = `${newDatePart.year}$1${newDatePart.month}$2${newDatePart.day}`;

assets/styles/layouts/article/_buttons.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ a.btn {
5656
margin-right: -.65rem;
5757
}
5858

59+
&.small {
60+
padding: .4rem 1rem;
61+
}
62+
5963
&.small-plus {
6064
padding: .25em;
6165
line-height: .65rem;
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
title: Query data in {{< product-name >}}
3+
description: >
4+
Learn to query data stored in InfluxDB using SQL and InfluxQL.
5+
menu:
6+
influxdb3_core:
7+
name: Query data
8+
weight: 4
9+
influxdb3/core/tags: [query]
10+
source: /shared/influxdb3-query-guides/_index.md
11+
---
12+
13+
<!--
14+
The content for this page is at content/shared/influxdb3-query-guides/_index.md
15+
-->
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
title: Execute queries
3+
description: >
4+
Use tools and libraries to query data stored in {{< product-name >}}.
5+
weight: 101
6+
menu:
7+
influxdb3_core:
8+
name: Execute queries
9+
parent: Query data
10+
influxdb3/core/tags: [query, sql, influxql]
11+
aliases:
12+
- /influxdb3/core/query-data/tools/
13+
- /influxdb3/core/query-data/sql/execute-queries/
14+
- /influxdb3/core/query-data/influxql/execute-queries/
15+
source: /shared/influxdb3-query-guides/execute-queries/_index.md
16+
---
17+
18+
<!--
19+
The content for this page is at content/shared/influxdb3-query-guides/execute-queries/_index.md
20+
-->
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
title: Use the InfluxDB v1 HTTP query API and InfluxQL to query data
3+
seotitle: Use InfluxQL and InfluxDB v1 HTTP query API
4+
list_title: Use the v1 query API and InfluxQL
5+
description: >
6+
Use the InfluxDB v1 HTTP query API to query data in {{< product-name >}}
7+
with InfluxQL.
8+
weight: 302
9+
menu:
10+
influxdb3_core:
11+
parent: Execute queries
12+
name: Use the v1 query API
13+
influxdb3/core/tags: [query, influxql, python]
14+
metadata: [InfluxQL]
15+
related:
16+
- /influxdb3/core/api-compatibility/v1/
17+
aliases:
18+
- /influxdb3/core/query-data/influxql/execute-queries/influxdb-v1-api/
19+
list_code_example: |
20+
```sh
21+
curl --get http://{{< influxdb/host >}}/query \
22+
--header "Authorization: Token DATABASE_TOKEN" \
23+
--data-urlencode "db=DATABASE_NAME" \
24+
--data-urlencode "q=SELECT * FROM home"
25+
```
26+
source: /shared/influxdb3-query-guides/execute-queries/influxdb-v1-api.md
27+
---
28+
29+
<!--
30+
The content for this page is at content/shared/influxdb3-query-guides/execute-queries/influxdb-v1-api.md
31+
-->
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
title: Use the influxdb3 CLI to query data
3+
list_title: Use the influxdb3 CLI
4+
description: >
5+
Use the `influxdb3 query` command to query data in {{< product-name >}} with SQL.
6+
weight: 301
7+
menu:
8+
influxdb3_core:
9+
parent: Execute queries
10+
name: Use the influxdb3 CLI
11+
influxdb3/core/tags: [query, sql, influxql, influxdb3, CLI]
12+
related:
13+
- /influxdb3/core/reference/cli/influxdb3/query/
14+
- /influxdb3/core/reference/sql/
15+
- /influxdb3/core/reference/influxql/
16+
# - /influxdb3/core/get-started/query/#execute-an-sql-query, Get started querying data
17+
list_code_example: |
18+
```sh
19+
influxdb3 query \
20+
--database DATABASE_NAME \
21+
"SELECT * FROM home"
22+
```
23+
source: /shared/influxdb3-query-guides/execute-queries/influxdb3-cli.md
24+
---
25+
26+
<!--
27+
The content for this page is at content/shared/influxdb3-query-guides/execute-queries/influxdb3-cli.md
28+
-->
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
title: Query data with InfluxQL
3+
description: >
4+
Learn to use InfluxQL to query data stored in {{< product-name >}}.
5+
menu:
6+
influxdb3_core:
7+
name: Query with InfluxQL
8+
parent: Query data
9+
weight: 102
10+
influxdb3/core/tags: [query, influxql]
11+
source: /shared/influxdb3-query-guides/influxql/_index.md
12+
---
13+
14+
<!--
15+
The content for this page is at content/shared/influxdb3-query-guides/influxql/_index.md
16+
-->
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
title: Aggregate data with InfluxQL
3+
seotitle: Aggregate or apply selector functions to data with InfluxQL
4+
description: >
5+
Use InfluxQL aggregate and selector functions to perform aggregate operations
6+
on your time series data.
7+
menu:
8+
influxdb3_core:
9+
name: Aggregate data
10+
parent: Query with InfluxQL
11+
identifier: query-influxql-aggregate
12+
weight: 203
13+
influxdb3/core/tags: [query, influxql]
14+
related:
15+
- /influxdb3/core/reference/influxql/functions/aggregates/
16+
- /influxdb3/core/reference/influxql/functions/selectors/
17+
list_code_example: |
18+
##### Aggregate fields by groups
19+
```sql
20+
SELECT
21+
MEAN(temp) AS mean,
22+
FIRST(hum) as first,
23+
FROM home
24+
GROUP BY tag
25+
```
26+
27+
##### Aggregate by time-based intervals
28+
```sql
29+
SELECT
30+
MEAN(temp),
31+
sum(hum),
32+
FROM home
33+
WHERE time >= now() - 24h
34+
GROUP BY time(1h),room
35+
```
36+
source: /shared/influxdb3-query-guides/influxql/aggregate-select.md
37+
---
38+
39+
<!--
40+
The content for this page is at content/shared/influxdb3-query-guides/influxql/aggregate-select.md
41+
-->
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
title: Perform a basic InfluxQL query
3+
seotitle: Perform a basic InfluxQL query in {{< product-name >}}
4+
description: >
5+
A basic InfluxQL query that queries data from InfluxDB most commonly includes
6+
`SELECT`, `FROM`, and `WHERE` clauses.
7+
menu:
8+
influxdb3_core:
9+
name: Basic query
10+
parent: Query with InfluxQL
11+
identifier: query-influxql-basic
12+
weight: 202
13+
influxdb3/core/tags: [query, influxql]
14+
list_code_example: |
15+
```sql
16+
SELECT temp, room FROM home WHERE time >= now() - 1d
17+
```
18+
source: /shared/influxdb3-query-guides/influxql/basic-query.md
19+
---
20+
21+
<!--
22+
The content for this page is at content/shared/influxdb3-query-guides/influxql/basic-query.md
23+
-->
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
title: Explore your schema with InfluxQL
3+
description: >
4+
Use InfluxQL `SHOW` statements to return information about your data schema.
5+
menu:
6+
influxdb3_core:
7+
name: Explore your schema
8+
parent: Query with InfluxQL
9+
identifier: query-influxql-schema
10+
weight: 201
11+
influxdb3/core/tags: [query, influxql]
12+
related:
13+
- /influxdb3/core/reference/influxql/show/
14+
list_code_example: |
15+
##### List measurements
16+
```sql
17+
SHOW MEASUREMENTS
18+
```
19+
20+
##### List field keys in a measurement
21+
```sql
22+
SHOW FIELD KEYS FROM "measurement"
23+
```
24+
25+
##### List tag keys in a measurement
26+
```sql
27+
SHOW TAG KEYS FROM "measurement"
28+
```
29+
30+
##### List tag values for a specific tag key
31+
```sql
32+
SHOW TAG VALUES FROM "measurement" WITH KEY = "tag-key" WHERE time > now() - 1d
33+
```
34+
source: /shared/influxdb3-query-guides/influxql/explore-schema.md
35+
---
36+
37+
<!--
38+
The content for this page is at content/shared/influxdb3-query-guides/influxql/explore-schema.md
39+
-->

0 commit comments

Comments
 (0)