Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DOCS] Adds Lens Inspector and minor edits #109736

Merged
merged 5 commits into from
Sep 2, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 2 additions & 24 deletions docs/user/dashboard/dashboard.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -283,37 +283,15 @@ To enable series interactions, refer to <<settings-explore-data-in-chart,`xpack.
[[download-csv]]
== Download panel data

Download panel data in a CSV file. You can download most panels in a CSV file, but there is a shortcut available
for *Lens* panels.

[float]
[role="xpack"]
[[download-lens-data]]
=== Download Lens data

When you download *Lens* panel data, each layer produces a single CSV file with columns.
When you download multiple layers, the file names combine the visualization and layer index names.

. Open the *Lens* panel menu

. Select *More > Download as CSV*.

[float]
[[download-other-panel-data]]
=== Download all other panel data

Download the data for non-*Lens* panels.
Download panel data in a CSV file. When you download visualization panels with multiple layers, each layer produces a CSV file, and the file names contain the visualization and layer index names.

. Open the panel menu, then select *Inspect*.

. Click *Download CSV*, then select the CSV type from the dropdown:
. Click *Download CSV*, then select the format type from the dropdown:

* *Formatted CSV* &mdash; Contains human-readable dates and numbers.

* *Unformatted* &mdash; Best used for computer use.
+
[role="screenshot"]
image:images/Dashboard_inspect.png[Inspect in dashboard]

[float]
[[defer-loading-panels-below-the-fold]]
Expand Down
67 changes: 37 additions & 30 deletions docs/user/dashboard/lens.asciidoc
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
[[lens]]
=== Lens
=== Create visualizations with Lens
++++
<titleabbrev>Lens</titleabbrev>
++++

To create visualization panels with *Lens*, you drag the data fields you want to visualize to the workspace, then *Lens* uses heuristics to apply each field and create a visualization for you.
To create a visualization, drag the data fields you want to visualize to the workspace, then *Lens* uses visualization best practices to apply the fields and create a visualization that best displays the data.

With *Lens*, you can:

* Create area, line, and bar charts with multiple layers, indices, and visualization types.
* Change the aggregation function and labels to customize the data.
* Create area, line, and bar charts with layers to display multiple indices and chart types.
* Change the aggregation function to change how the data displays.
KOTungseth marked this conversation as resolved.
Show resolved Hide resolved
* Perform math on aggregations using *Formula*.
* Use time shifts to compare data for two time intervals, such as month over month.
* Use time shifts to compare the data in two time intervals, such as month over month.
* Create custom tables.

++++
<script type="text/javascript" async
Expand All @@ -32,15 +36,23 @@ If you're unsure about the visualization type you want to use, or how you want t

If you already know the visualization type you want to use, and how you want to display the data, use the following process:

* *Choose the visualization type.* Open the *Chart type* dropdown, then select the visualization type before you drag any fields.
+
To view more visualizations that *Lens* automatically created for the fields, click the *Suggestions*. If one of the *Suggestions* meets your visualization needs, click *Save and return* to add it to the dashboard.
*Choose the visualization type.*
KOTungseth marked this conversation as resolved.
Show resolved Hide resolved

* *Choose the data you want to visualize.* Drag the fields directly to the layer pane. *Lens* automatically selects the aggregation function.
+
If you want to learn more about the data a field contains, click *i* next to the field.
. Before you drag fields to the workspace, open the *Chart type* dropdown, then select the visualization type.

. To view more visualizations that *Lens* automatically created for the fields, click the *Suggestions*. If one of the *Suggestions* meets your visualization needs, click *Save and return* to add it to the dashboard.
KOTungseth marked this conversation as resolved.
Show resolved Hide resolved

*Choose the data you want to visualize.*
KOTungseth marked this conversation as resolved.
Show resolved Hide resolved

* *Edit and delete.* To change the *Quick function* and display options, click the field in the layer pane. To delete a field, close the configuration options, then click *X* next to the field.
. Drag the fields directly to the layer pane. *Lens* automatically selects the aggregation function.

. If you want to learn more about the data a field contains, click *i* next to the field.
KOTungseth marked this conversation as resolved.
Show resolved Hide resolved

*Edit and delete.*
KOTungseth marked this conversation as resolved.
Show resolved Hide resolved

. To change the aggregation *Quick function* and display options, click the field in the layer pane.

. To delete a field, close the configuration options, then click *X* next to the field.

[float]
[[change-the-fields]]
Expand Down Expand Up @@ -69,23 +81,20 @@ Formulas allow you to perform math on aggregated data. The most common formulas

. Click *Formula*, then enter the formula.
+
Filter ratio example:: Use `kql=''` to filter one set of documents, then compare the document set to other documents within the same grouping:
+
See how the error rate changes over time:
Filter ratio example:: To filter a document set, use `kql=''`, then compare to other documents within the same grouping:
+
```
count(kql='response.status_code > 400') / count()
```
+
Week over week example:: Use `shift='1w'` to get the value of each grouping from the previous week. Time shift should not be used with the *Top values* function.
Week over week example:: To get the value for each grouping from the previous week, use `shift='1w'`. Do not use time shift formulas with the *Top values* function.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not use time shift formulas with the Top values function.

It's unfortunately not that simple. You can do top values & a shift at the same time....but if your formula contains both a shift & no shift, for example then the top values function won't work.

I'll be sitting here for the next few minutes trying to think of a simple way to say that 😖

Copy link
Contributor

@ghudgins ghudgins Aug 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about: If your formula contains a time shift and a non-shifted metric then you cannot currently use Top Values.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the current error message says it better, as the problem is with multiple different time shift rather than time shift vs non-time shift:

It is not possible to combine different time shifts with the Top values function.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think specifying the different time shifts instead of saying different is clearer. On the other hand, using different is a simpler way of stating this, especially when I finally understood the different time shifts "types".

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dej611 is better at english than I am. my parents would be so proud 😂

nice one, sounds much better.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think specifying the different time shifts instead of saying different is clearer. On the other hand, using different is a simpler way of stating this, especially when I finally understood the different time shifts "types".

I thought about different formulations, but the main point, at the end, is not mixing them:

count(shift="1w") - count() // "different": in this case is 1w vs 0 shift
count(shift="1w") - count(shift="1m") // "different": in this case is 1w vs 1m

Of course when Top values is selected as function on other dimensions.
We might think to include this type of example as well to better explain, but it's probably too much.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated! Double check my work?

+
```
percentile(system.network.in.bytes, percentile=99) /
percentile(system.network.in.bytes, percentile=99, shift='1w')
```
+
Percent of total example:: Formulas can calculate `overall_sum` for all the groupings,
which lets you convert each grouping into a percent of total:
Percent of total example:: To convert each grouping into a percent of the total, formulas calculate `overall_sum` for all groupings:
+
```
sum(products.base_price) / overall_sum(sum(products.base_price))
Expand All @@ -112,7 +121,7 @@ For a time shift example, refer to <<compare-time-ranges>>.
[[create-custom-tables]]
==== Create custom tables

*Lens* tables are highly customizable, and provide you with text alignment, value formatting, coloring options, and more.
Tables are highly customizable, and provide you with text alignment, value formatting, coloring options, and more.

. From the *Chart type* dropdown, select *Table*.

Expand Down Expand Up @@ -184,13 +193,11 @@ image::images/lens_value_labels_partition_toggle.png[Lens Pie chart value labels

[float]
[[filter-the-data]]
==== Filter the data

Apply filters to visualizations directly from the values in the legend. Only *Bar*, *Line and area*, and *Proportion* visualizations support legend filters.
==== Apply filters with the legend

. In the legend, click the field.
Apply filters to visualizations directly from the values in the legend. *Bar*, *Line and area*, and *Proportion* visualizations support legend filters.

. Choose one of the following options:
In the legend, click the field, then choose one of the following options:

* *Filter for value* &mdash; Applies a filter that displays only the field data in the visualization.

Expand Down Expand Up @@ -287,7 +294,7 @@ Use formulas to compare multiple {es} aggregations that can be filtered or shift

[discrete]
[[is-it-possible-to-have-more-than-one-Y-axis-scale]]
.*Can I add more than one y-axis scale to a visualization?*
.*Can I add more than one y-axis scale?*
[%collapsible]
====
For each y-axis, you can select *Left* and *Right*, and configure a different scale.
Expand Down Expand Up @@ -327,12 +334,12 @@ refer to <<explore-fields-in-your-data,Explore the fields in your data>>.
.*Why is my field missing from the fields list?*
[%collapsible]
====
Fields do not appear in the *Available fields* in the following scenarios:
The following field types do not appear in the *Available fields* list:

* The field is a full-text field.
* The field is a `geo_point` field
* The field is a `flattened` field.
* The field is a `object` field.
* Full-text
* geo_point
* flattened
* object

Verify if the field appears in the *Empty fields* list. *Lens* uses heuristics to determine if the fields contain values. For sparse data sets, the heuristics are less precise.
====
Expand Down