File tree Expand file tree Collapse file tree 1 file changed +49
-0
lines changed
src/homepageExperience/components/steps/cli Expand file tree Collapse file tree 1 file changed +49
-0
lines changed Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments