在 Azure Monitor 中使用视图设计器创建自定义视图Create custom views by using View Designer in Azure Monitor

在 Azure Monitor 中使用视图设计器即可在 Azure 门户中创建各种自定义视图,使 Log Analytics 工作区中的数据可视化。By using View Designer in Azure Monitor, you can create a variety of custom views in the Azure portal that can help you visualize data in your Log Analytics workspace. 本文概述了视图设计器以及创建和编辑自定义视图的过程。This article presents an overview of View Designer and procedures for creating and editing custom views.

重要

Azure Monitor 中的视图已转换为提供附加功能的工作簿Views in Azure Monitor have been transitioned to workbooks which provide additional functionality. 有关将现有视图转换为工作簿的详细信息,请参阅 Azure Monitor 视图设计器转换为工作簿的指南See Azure Monitor view designer to workbooks transition guide for details on converting your existing views to workbooks.

有关视图设计器的详细信息,请参阅:For more information about View Designer, see:

  • 磁贴参考:针对自定义视图中的每个可用磁贴,提供了设置方面的参考指南。Tile reference: Provides a reference guide to the settings for each of the available tiles in your custom views.
  • 可视化部件参考:针对自定义视图中可用的可视化部件,提供了设置方面的参考指南。Visualization part reference: Provides a reference guide to the settings for the visualization parts that are available in your custom views.

概念Concepts

视图显示在 Azure 门户的 Azure Monitor“概述”**** 页中。Views are displayed in the Azure Monitor Overview page in the Azure portal. 通过点击“见解”部分下的“更多”,从“Azure Monitor”菜单打开此页面 。Open this page from the Azure Monitor menu by clicking More under the Insights section. 每个自定义视图中的磁贴都按字母顺序显示,监视解决方案的磁贴安装在同一工作区中。The tiles in each custom view are displayed alphabetically, and the tiles for the monitoring solutions are installed the same workspace.

概述页

使用视图设计器创建的视图所包含的元素在下表中进行了说明:The views that you create with View Designer contain the elements that are described in the following table:

组成部分Part 说明Description
磁贴Tiles 显示在 Azure Monitor“概述”**** 页上。Are displayed on your Azure Monitor Overview page. 每个磁贴都会显示一个可视化摘要,其中包含磁贴所代表的自定义视图。Each tile displays a visual summary of the custom view it represents. 每个磁贴类型提供的记录可视化效果各不相同。Each tile type provides a different visualization of your records. 选择磁贴即可显示自定义视图。You select a tile to display a custom view.
自定义视图Custom view 在选择磁贴时显示。Displayed when you select a tile. 每个视图包含一个或多个可视化部件。Each view contains one or more visualization parts.
可视化部件Visualization parts 根据一个或多个日志查询,提供 Log Analytics 工作区中数据的可视化效果。Present a visualization of data in the Log Analytics workspace based on one or more log queries. 大多数部件会包括提供高级可视化效果的标头,以及显示最匹配结果的列表。Most parts include a header, which provides a high-level visualization, and a list, which displays the top results. 每个部件类型提供了 Log Analytics 工作区中记录的不同可视化效果。Each part type provides a different visualization of the records in the Log Analytics workspace. 选择部件中的元素即可进行日志查询,获取详细的记录。You select elements in the part to perform a log query that provides detailed records.

所需的权限Required permissions

你至少需要 Log Analytics 工作区中的参与者级别权限,才能创建或修改视图。You require at least contributor level permissions in the Log Analytics workspace to create or modify views. 如果没有此权限,则菜单中不会显示“视图设计器”选项。If you don't have this permission, then the View Designer option won't be displayed in the menu.

使用现有视图Work with an existing view

使用视图设计器创建的视图显示以下选项:Views that were created with View Designer display the following options:

概述菜单

下表描述了这些选项:The options are described in the following table:

选项Option 说明Description
刷新Refresh 使用最新数据刷新视图。Refreshes the view with the latest data.
日志Logs 打开 Log Analytics,使用日志查询对数据进行分析。Opens the Log Analytics to analyze data with log queries.
编辑Edit 在视图设计器中打开视图,以便编辑其内容和配置。Opens the view in View Designer to edit its contents and configuration.
克隆Clone 创建一个新视图,并在视图设计器中打开它。Creates a new view and opens it in View Designer. 新视图的名称与原始名称相同,但其末尾附加了 Copy 字样。The name of the new view is the same as the original name, but with Copy appended to it.
日期范围Date range 为视图中包含的数据设置日期和时间范围筛选器。Set the date and time range filter for the data that's included in the view. 在视图中的查询中设置任何日期范围前,将应用此日期范围。This date range is applied before any date ranges set in queries in the view.
+ 定义为视图定义的自定义筛选器。Define a custom filter that's defined for the view.

创建新视图Create a new view

可以在视图设计器中创建新视图,方法是在 Log Analytics 工作区的菜单中选择“视图设计器”****。You can create a new view in View Designer by selecting View Designer in the menu of your Log Analytics workspace.

视图设计器磁贴

使用视图设计器Work with View Designer

使用视图设计器来创建新视图或编辑现有视图。You use View Designer to create new views or edit existing ones.

视图设计器有三个窗格:View Designer has three panes:

  • 设计:包含正在创建或编辑的自定义视图。Design: Contains the custom view that you're creating or editing.
  • 控件:包含添加到“设计”窗格的磁贴和部件。****Controls: Contains the tiles and parts that you add to the Design pane.
  • 属性:显示磁贴或所选部件的属性。Properties: Displays the properties of the tiles or selected parts.

视图设计器

配置视图磁贴Configure the view tile

一个自定义视图只能有一个磁贴。A custom view can have only a single tile. 若要查看当前磁贴或选择另一个磁贴,请在“控件”**** 窗格中选择“磁贴”**** 选项卡。To view the current tile or select an alternate one, select the Tile tab in the Control pane. “属性”**** 窗格会显示当前磁贴的属性。The Properties pane displays the properties of the current tile.

可以根据磁贴参考中的信息配置磁贴属性,然后单击“应用”****,保存所做的更改。You can configure the tile properties according to the information in the Tile reference and then click Apply to save the changes.

配置可视化部件Configure the visualization parts

视图中可以包含任何数量的可视化部件。A view can include any number of visualization parts. 若要向视图添加部件,请选择“视图”**** 选项卡,然后选择可视化部件。To add parts to a view, select the View tab, and then select a visualization part. ****“属性”窗格显示所选部件的属性。The Properties pane displays the properties of the selected part.

可以根据可视化部件参考中的信息配置视图属性,然后单击“应用”****,保存所做的更改。You can configure the view properties according to the information in the Visualization part reference and then click Apply to save the changes.

视图只有一行可视化部件。Views have only one row of visualization parts. 可以重新排列现有部件,只需将其拖至新位置即可。You can rearrange the existing parts by dragging them to a new location.

可以通过以下方式从视图中删除可视化部件:选择该部件右上角的“X”****。You can remove a visualization part from the view by selecting the X at the top right of the part.

下表介绍了以编辑模式使用视图的选项。The options for working with views in edit mode are described in the following table.

编辑菜单

选项Option 说明Description
保存Save 保存所做的更改并关闭视图。Saves your changes and closes the view.
取消Cancel 放弃所做的更改并关闭视图。Discards your changes and closes the view.
删除视图Delete View 删除视图。Deletes the view.
ExportExport 将视图导出至 Azure 资源管理器模板,可将此模板导入其它工作区。Exports the view to an Azure Resource Manager template that you can import into another workspace. 文件的名称为视图的名称,包含 omsview 扩展名。The name of the file is the name of the view, and it has an omsview extension.
ImportImport 导入从另一个工作区中导出的 omsview 文件。Imports the omsview file that you exported from another workspace. 此操作覆盖现有视图的配置。This action overwrites the configuration of the existing view.
克隆Clone 创建一个新视图,并在视图设计器中打开它。Creates a new view and opens it in View Designer. 新视图的名称与原始名称相同,但其末尾附加了 Copy 字样。The name of the new view is the same as the original name, but with Copy appended to it.

后续步骤Next steps