Skip to content

Commit 3be0b51

Browse files
authored
feat: add execute flux query page to cli wizard (#5113)
* feat: add execute flux query page to cli wizard
1 parent e49ebc1 commit 3be0b51

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import React from 'react'
2+
3+
import CodeSnippet from 'src/shared/components/CodeSnippet'
4+
import {event} from 'src/cloud/utils/reporting'
5+
import {SafeBlankLink} from 'src/utils/SafeBlankLink'
6+
7+
const logCopyCodeSnippet = () => {
8+
event('firstMile.cliWizard.executeQuery.code.copied')
9+
}
10+
11+
export const ExecuteQuery = () => {
12+
const query = `influx query 'from(bucket:"sample-bucket") |> range(start:-10m)' --raw`
13+
14+
const fluxExample = `from(bucket: “weather-data”)
15+
|> range(start: -10m)
16+
|> filter(fn: (r) => r._measurement == “temperature”)`
17+
18+
return (
19+
<>
20+
<h1>Execute a Flux Query</h1>
21+
<p>
22+
Now let's query the data we wrote into the database. We use the Flux
23+
scripting language to query data.{' '}
24+
<SafeBlankLink href="https://docs.influxdata.com/influxdb/v2.2/reference/syntax/flux/">
25+
Flux
26+
</SafeBlankLink>{' '}
27+
is designed for querying, analyzing, and acting on data.
28+
<br />
29+
<br />
30+
Here's an example of a basic Flux script:
31+
</p>
32+
<CodeSnippet
33+
text={fluxExample}
34+
showCopyControl={false}
35+
language="properties"
36+
></CodeSnippet>
37+
<p style={{marginTop: '60px'}}>
38+
Let's write a Flux query in the InfluxCLI to read back all of the data
39+
you wrote in the previous step. Copy the code snippet below into the
40+
InfluxCLI.
41+
</p>
42+
<CodeSnippet
43+
text={query}
44+
onCopy={logCopyCodeSnippet}
45+
language="properties"
46+
/>
47+
</>
48+
)
49+
}

0 commit comments

Comments
 (0)