Create a notebook
To create a new notebook, do the following:
In the navigation menu on the left, click Notebooks.
Notebooks
In the Notebooks page, select one of the following options under Create a Notebook:
- New Notebook: includes a query builder cell, a , and a visualization cell.
- Set an Alert: includes a , a validation cell, a , and an alert builder cell.
- Schedule a Task: includes a , a validation cell, and a .
- Write a Flux Script: includes a Flux script editor cell, and a .
Enter a name for your notebook in the Untitled Notebook field.
Do the following at the top of the page:
- Select your local time zone or UTC.
Your notebook should have a Data Source cell as the first cell. Data Source cells provide data to subsequent cells. The presets (listed in step 2) include either a Query Builder or a Flux Script as the first cell.
To define your data source query, do one of the following:
- If your notebook uses a Query Builder cell, select your bucket and any additional filters for your query.
- If your notebook uses a Flux Script cell, enter or paste a Flux script.
Select and click Preview (or press CTRL + Enter) under the notebook title. InfluxDB displays query results in Validate the Data and Visualize the Result without writing data or running actions.
(Optional) Change your visualization settings with the drop-down menu and the Configure button at the top of the Visualize the Result cell.
(Optional) Toggle the Presentation switch to display visualization cells and hide all other cells.
(Optional) To run your notebook actions, select and click Run under the notebook title.
(Optional) To add a new cell, follow the steps for one of the cell types:
- (Optional) to view and edit the code.
Use Data Source cells
To edit the raw Flux script of a Query Builder cell, convert the cell to Flux.
You can’t convert a Flux Script editor cell to a Query Builder cell. Once you convert a Query Builder cell to a Flux Script editor cell, you can’t convert it back.
Click the icon in the Query Builder cell you want to edit as Flux, and then select Convert to |> Flux. You won’t be able to undo this step.
A Flux Script editor cell containing the raw Flux script replaces the Query Builder cell.
View and edit the Flux script as needed.
- To change your , select a new type from the drop-down list at the top of the cell.
- (For histogram only) To specify values, click Select.
- To configure the visualization, click Configure.
- To download results as an annotated CSV file, click the CSV button.
- To export to the dashboard, click Export to Dashboard.
Add a data source cell
Add a to pull information into your notebook.
To add a data source cell, do the following:
- Click .
- Select Flux Script or Query Builder as your input, and then select or enter the bucket to pull data from.
- Select filters to narrow your data.
- Select Preview (CTRL + Enter) or Run in the upper left drop-down list.
A validation cell uses the Table visualization type to display query results from a data source cell.
To add a Table visualization cell, do the following:
- Under Visualization, click Table.
Add a visualization cell
To add a Table visualization cell, do the following:
Click .
Under Visualization, select one of the following visualization cell-types:
- Table: Display data in tabular format.
- Graph: Visualize data using InfluxDB visualizations.
- Note: Use Markdown to add notes or other information to your notebook.
To modify a visualization cell, see use visualization cells. For detail on available visualization types and how to use them, see .
Add an action cell to create an , process data with a task , or output data to a bucket.
If your cell contains a custom script that uses any output function to write data to InfluxDB (for example: the function) or sends data to a third-party service, clicking Preview will write data.
To add an alert to your notebook, do the following:
- Enter a time range to automatically check the data and enter your query offset.
- Customize the conditions to send an alert.
- Select an endpoint to receive an alert:
- Slack and a Slack Channel
- HTTP post
- PagerDuty
(Optional) Personalize your message. By default, the message is:
Click Test Alert to send a test message to your configured Endpoint. The test will not schedule the new alert.
- Click Export Alert Task to create your alert.
To write Data Source results to a bucket, do the following:
- Click .
- Click Output to Bucket.
- In the Choose a bucket drop-down list, select or create a bucket.
- Click Preview to view the query result in validation cells.
- Select and click Run in the upper left to write the query result to the bucket.
To add a to your notebook, do the following:
- Click .
- Click Task.
- Enter a time and an offset to schedule the task.