Skip to content

Commit daed913

Browse files
authored
Merge branch 'master' into docs/v3/write-steps
2 parents 66f9886 + 253c16a commit daed913

File tree

8 files changed

+615
-615
lines changed

8 files changed

+615
-615
lines changed

.github/copilot-instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ GitHub Copilot should help document InfluxData products by creating clear, accur
5959
- Follow Google Developer Documentation style guidelines
6060
- For API references, follow YouTube Data API style
6161
- Use semantic line feeds (one sentence per line)
62-
- Use only h2-h6 headings in content (h1 comes from frontmatter)
62+
- Use only h2-h6 headings in content (h1 comes from frontmatter title properties)
6363
- Use sentence case for headings
6464
- Use GitHub callout syntax
6565
- Image naming: `project/version-context-description.png`

content/influxdb3/core/plugins.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,13 @@ menu:
77
influxdb3_core:
88
name: Processing engine and Python plugins
99
weight: 4
10-
influxdb3/core/tags: []
10+
influxdb3/core/tags: [processing engine, python]
1111
related:
1212
- /influxdb3/core/reference/cli/influxdb3/test/wal_plugin/
13-
- /influxdb3/core/reference/cli/influxdb3/create/plugin/
1413
- /influxdb3/core/reference/cli/influxdb3/create/trigger/
1514
source: /shared/v3-core-plugins/_index.md
1615
---
1716

1817
<!--
19-
The content of this page is at /shared/v3-core-plugins/_index.md
18+
//SOURCE - content/shared/v3-core-plugins/_index.md
2019
-->

content/influxdb3/core/reference/cli/influxdb3/create/trigger.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ menu:
88
parent: influxdb3 create
99
name: influxdb3 create trigger
1010
weight: 400
11+
alias: /influxdb3/core/cli/influxdb3/create/plugin/
1112
source: /shared/influxdb3-cli/create/trigger.md
1213
---
1314

1415
<!--
15-
The content of this file is at content/shared/influxdb3-cli/create/trigger.md
16+
//SOURCE - content/shared/influxdb3-cli/create/trigger.md
1617
-->

content/influxdb3/enterprise/plugins.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,13 @@ menu:
77
influxdb3_enterprise:
88
name: Processing Engine and Python plugins
99
weight: 4
10-
influxdb3/core/tags: []
10+
influxdb3/enterprise/tags: [processing engine, python]
1111
related:
1212
- /influxdb3/enterprise/reference/cli/influxdb3/test/wal_plugin/
13-
- /influxdb3/enterprise/reference/cli/influxdb3/create/plugin/
1413
- /influxdb3/enterprise/reference/cli/influxdb3/create/trigger/
1514
source: /shared/v3-core-plugins/_index.md
1615
---
1716

1817
<!--
19-
The content of this page is at /shared/v3-core-plugins/_index.md
18+
//SOURCE - content/shared/v3-core-plugins/_index.md
2019
-->

content/influxdb3/enterprise/reference/cli/influxdb3/create/trigger.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ menu:
88
parent: influxdb3 create
99
name: influxdb3 create trigger
1010
weight: 400
11+
alias: /influxdb3/enterprise/cli/influxdb3/create/plugin/
1112
source: /shared/influxdb3-cli/create/trigger.md
1213
---
1314

1415
<!--
15-
The content of this file is at content/shared/influxdb3-cli/create/trigger.md
16+
//SOURCE - content/shared/influxdb3-cli/create/trigger.md
1617
-->

content/shared/v3-core-get-started/_index.md

Lines changed: 56 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -156,15 +156,17 @@ The following examples show how to start InfluxDB 3 with different object store
156156
```bash
157157
# Memory object store
158158
# Stores data in RAM; doesn't persist data
159-
influxdb3 serve --node-id=host01 --object-store=memory
159+
influxdb3 serve \
160+
--node-id host01 \
161+
--object-store memory
160162
```
161163

162164
```bash
163165
# Filesystem object store
164166
# Provide the filesystem directory
165167
influxdb3 serve \
166-
--node-id=host01 \
167-
--object-store=file \
168+
--node-id host01 \
169+
--object-store file \
168170
--data-dir ~/.influxdb3
169171
```
170172

@@ -196,24 +198,24 @@ docker run -it \
196198
# S3 object store (default is the us-east-1 region)
197199
# Specify the Object store type and associated options
198200
influxdb3 serve \
199-
--node-id=host01 \
200-
--object-store=s3 \
201-
--bucket=BUCKET \
202-
--aws-access-key=AWS_ACCESS_KEY \
203-
--aws-secret-access-key=AWS_SECRET_ACCESS_KEY
201+
--node-id host01 \
202+
--object-store s3 \
203+
--bucket BUCKET \
204+
--aws-access-key AWS_ACCESS_KEY_ID \
205+
--aws-secret-access-key AWS_SECRET_ACCESS_KEY
204206
```
205207

206208
```bash
207209
# Minio or other open source object store
208210
# (using the AWS S3 API with additional parameters)
209211
# Specify the object store type and associated options
210212
influxdb3 serve \
211-
--node-id=host01 \
212-
--object-store=s3 \
213-
--bucket=BUCKET \
214-
--aws-access-key=AWS_ACCESS_KEY \
215-
--aws-secret-access-key=AWS_SECRET_ACCESS_KEY \
216-
--aws-endpoint=ENDPOINT \
213+
--node-id host01 \
214+
--object-store s3 \
215+
--bucket BUCKET \
216+
--aws-access-key-id AWS_ACCESS_KEY_ID \
217+
--aws-secret-access-key AWS_SECRET_ACCESS_KEY \
218+
--aws-endpoint ENDPOINT \
217219
--aws-allow-http
218220
```
219221

@@ -314,7 +316,7 @@ cpu,host=Alpha,region=us-west,application=webserver val=6i,usage_percent=25.3,st
314316
If you save the preceding line protocol to a file (for example, `server_data`), then you can use the `influxdb3` CLI to write the data--for example:
315317
316318
```bash
317-
influxdb3 write --database=mydb --file=server_data
319+
influxdb3 write --database mydb --file server_data
318320
```
319321
320322
##### Example: write data using the /api/v3 HTTP API
@@ -410,7 +412,11 @@ curl "http://localhost:8181/api/v3/write_lp?db=sensors&precision=auto&no_sync=tr
410412
The `no_sync` CLI option controls when writes are acknowledged--for example:
411413
412414
```bash
413-
influxdb3 write --bucket=mydb --org=my_org --token=my-token --no-sync
415+
influxdb3 write \
416+
--bucket mydb \
417+
--org my_org \
418+
--token my-token \
419+
--no-sync
414420
```
415421
416422
### Create a database or table
@@ -456,7 +462,7 @@ The `query` subcommand includes options to help ensure that the right database i
456462
#### Example: query `“SHOW TABLES”` on the `servers` database:
457463
458464
```console
459-
$ influxdb3 query --database=servers "SHOW TABLES"
465+
$ influxdb3 query --database servers "SHOW TABLES"
460466
+---------------+--------------------+--------------+------------+
461467
| table_catalog | table_schema | table_name | table_type |
462468
+---------------+--------------------+--------------+------------+
@@ -472,7 +478,7 @@ $ influxdb3 query --database=servers "SHOW TABLES"
472478
#### Example: query the `cpu` table, limiting to 10 rows:
473479
474480
```console
475-
$ influxdb3 query --database=servers "SELECT DISTINCT usage_percent, time FROM cpu LIMIT 10"
481+
$ influxdb3 query --database servers "SELECT DISTINCT usage_percent, time FROM cpu LIMIT 10"
476482
+---------------+---------------------+
477483
| usage_percent | time |
478484
+---------------+---------------------+
@@ -496,7 +502,10 @@ $ influxdb3 query --database=servers "SELECT DISTINCT usage_percent, time FROM c
496502
To query using InfluxQL, enter the `influxdb3 query` subcommand and specify `influxql` in the language option--for example:
497503
498504
```bash
499-
influxdb3 query --database=servers --language=influxql "SELECT DISTINCT usage_percent FROM cpu WHERE time >= now() - 1d"
505+
influxdb3 query \
506+
--database servers \
507+
--language influxql \
508+
"SELECT DISTINCT usage_percent FROM cpu WHERE time >= now() - 1d"
500509
```
501510
502511
### Query using the API
@@ -607,11 +616,11 @@ The following command creates a last value cache named `cpuCache`:
607616
608617
```bash
609618
influxdb3 create last_cache \
610-
--database=servers \
611-
--table=cpu \
612-
--key-columns=host,application \
613-
--value-columns=usage_percent,status \
614-
--count=5 cpuCache
619+
--database servers \
620+
--table cpu \
621+
--key-columns host,application \
622+
--value-columns usage_percent,status \
623+
--count 5 cpuCache
615624
```
616625
617626
_You can create a last values cache per time series, but be mindful of high cardinality tables that could take excessive memory._
@@ -622,7 +631,7 @@ To use the LVC, call it using the `last_cache()` function in your query--for exa
622631
623632
```bash
624633
influxdb3 query \
625-
--database=servers \
634+
--database servers \
626635
"SELECT * FROM last_cache('cpu', 'cpuCache') WHERE host = 'Bravo';"
627636
```
628637
@@ -637,8 +646,8 @@ Use the `influxdb3` CLI to [delete a last values cache](/influxdb3/version/refer
637646
638647
```bash
639648
influxdb3 delete last_cache \
640-
-d <DATABASE_NAME> \
641-
-t <TABLE> \
649+
--database <DATABASE_NAME> \
650+
--table <TABLE> \
642651
--cache-name <CACHE_NAME>
643652
```
644653
@@ -650,8 +659,8 @@ You can use the `influxdb3` CLI to [create a distinct values cache](/influxdb3/v
650659
651660
```bash
652661
influxdb3 create distinct_cache \
653-
-d <DATABASE_NAME> \
654-
-t <TABLE> \
662+
--database <DATABASE_NAME> \
663+
--table <TABLE> \
655664
--columns <COLUMNS> \
656665
[CACHE_NAME]
657666
```
@@ -670,9 +679,9 @@ The following command creates a distinct values cache named `cpuDistinctCache`:
670679
671680
```bash
672681
influxdb3 create distinct_cache \
673-
--database=servers \
674-
--table=cpu \
675-
--columns=host,application \
682+
--database servers \
683+
--table cpu \
684+
--columns host,application \
676685
cpuDistinctCache
677686
```
678687
@@ -682,25 +691,23 @@ To use the distinct values cache, call it using the `distinct_cache()` function
682691
683692
```bash
684693
influxdb3 query \
685-
--database=servers \
694+
--database servers \
686695
"SELECT * FROM distinct_cache('cpu', 'cpuDistinctCache')"
687696
```
688697
689698
> [!Note]
690699
> #### Only works with SQL
691700
>
692-
> The Distinct cache only works with SQL, not InfluxQL; SQL is the default language.
693-
694-
701+
> The distinct cache only works with SQL, not InfluxQL; SQL is the default language.
695702
696703
#### Delete a distinct values cache
697704
698705
Use the `influxdb3` CLI to [delete a distinct values cache](/influxdb3/version/reference/cli/influxdb3/delete/distinct_cache/)
699706
700707
```bash
701708
influxdb3 delete distinct_cache \
702-
-d <DATABASE_NAME> \
703-
-t <TABLE> \
709+
--database <DATABASE_NAME> \
710+
--table <TABLE> \
704711
--cache-name <CACHE_NAME>
705712
```
706713
@@ -726,12 +733,12 @@ InfluxDB 3 provides the following types of triggers, each with specific trigger-
726733
727734
- **On WAL flush**: Sends a batch of written data (for a specific table or all tables) to a plugin (by default, every second).
728735
- **On Schedule**: Executes a plugin on a user-configured schedule (using a crontab or a duration); useful for data collection and deadman monitoring.
729-
- **On Request**: Binds a plugin to a custom HTTP API endpoint at `/api/v3/engine/<ENDPOINT>`.
736+
- **On Request**: Binds a plugin to a custom HTTP API endpoint at `/api/v3/engine/<ENDPOINT_PATH>`.
730737
The plugin receives the HTTP request headers and content, and can then parse, process, and send the data into the database or to third-party services.
731738
732739
### Test, create, and trigger plugin code
733740
734-
##### Example: Python plugin for WAL flush
741+
##### Example: Python plugin for WAL rows
735742
736743
```python
737744
# This is the basic structure for Python plugin code that runs in the
@@ -817,7 +824,7 @@ To test a plugin, do the following:
817824
818825
1. Create a _plugin directory_--for example, `/path/to/.influxdb/plugins`
819826
2. [Start the InfluxDB server](#start-influxdb) and include the `--plugin-dir <PATH>` option.
820-
3. Save the [preceding example code](#example-python-plugin) to a plugin file inside of the plugin directory. If you haven't yet written data to the table in the example, comment out the lines where it queries.
827+
3. Save the [example plugin code](#example-python-plugin-for-wal-flush) to a plugin file inside of the plugin directory. If you haven't yet written data to the table in the example, comment out the lines where it queries.
821828
4. To run the test, enter the following command with the following options:
822829
823830
- `--lp` or `--file`: The line protocol to test
@@ -853,19 +860,19 @@ trigger:
853860
# - A Python plugin file named `test.py`
854861
# Test a plugin
855862
influxdb3 test wal_plugin \
856-
--lp="my_measure,tag1=asdf f1=1.0 123" \
857-
-d mydb \
858-
--input-arguments="arg1=hello,arg2=world" \
863+
--lp "my_measure,tag1=asdf f1=1.0 123" \
864+
--database mydb \
865+
--input-arguments "arg1=hello,arg2=world" \
859866
test.py
860867
```
861868
862869
```bash
863870
# Create a trigger that runs the plugin
864871
influxdb3 create trigger \
865872
-d mydb \
866-
--plugin=test_plugin \
867-
--trigger-spec="table:foo" \
868-
--trigger-arguments="arg1=hello,arg2=world" \
873+
--plugin test_plugin \
874+
--trigger-spec "table:foo" \
875+
--trigger-arguments "arg1=hello,arg2=world" \
869876
trigger1
870877
```
871878
@@ -875,3 +882,5 @@ enable the trigger and have it run the plugin as you write data:
875882
```bash
876883
influxdb3 enable trigger --database mydb trigger1
877884
```
885+
886+
For more information, see [Python plugins and the Processing engine](/influxdb3/version/plugins/).

0 commit comments

Comments
 (0)