英文:
choropleth map does not render in Dashboard Studio but it does in Classic Dashboards
问题
我需要绘制世界地图并根据计数对国家进行着色,然后将其添加到仪表板。这是我的查询:
...<省略> AS iso2
| search iso2=*
| stats count by iso2
| lookup geo_attr_countries iso2 OUTPUT country
| fields+ count, country
| geom geo_countries featureIdField="country"
这在搜索页面上运行正常。选择可视化=Choropleth Map时,它会正确绘制。我将其添加到Classic Dashboard类型的仪表板上时,它也正常运行。但是,当我将相同的查询添加到Dashboard Studio类型的仪表板上时,它不起作用。我收到一个错误消息:
Cannot read properties of undefined (reading 'warn')
如何修复这个问题?
英文:
I need to plot a world map and color countries based on the count and this to a dashboard. This is my query
...<ommitted> AS iso2
| search iso2=*
| stats count by iso2
| lookup geo_attr_countries iso2 OUTPUT country
| fields+ count, country
| geom geo_countries featureIdField="country"
This works fine on the search page. When Visualization=Choropleth Map is chosen it plots correctly. I add it on a Classic Dashboard type dashboard and it works fine. But when I add the same query to a Dashboard Studio type dashboard, it doesn't work. I get an error
Cannot read properties of undefined (reading 'warn')
How to fix this?
答案1
得分: 0
了解您的数据列
当您创建一个用于生成分区地图的搜索时,搜索将具有一列字段,通常是州、国家或地区。这一列通常等同于设置 primary[0],即结果的第一列。至少应该有另外一列,将数值与第一列中的每个字段关联起来(也可以配置颜色来表示 NULL 值)。这通常是搜索结果中的第二列,但并不总是等同于设置 primary[1]。如果您想要使用的数字值在不同的列中,可以使用等同于设置 primary[n-1],其中 n 等于列的数量。
文档链接 - https://docs.splunk.com/Documentation/Splunk/9.1.0/DashStudio/mapsChor
根据这个,我修改了我的查询如下,并且它有效:
| fields+ country, count
英文:
>Know your data columns
When you create a search to generate a choropleth map, the search will have a column of fields, usually states, countries, or regions. This column is usually equivalent to the setting primary[0], the first column of results. There should be at least one more column that relates a numeric value to each field in the first column (color for NULL values can also be configured). This is often, but not always, the second column in the search results, equivalent to the setting primary[1]. If the number values you want to use are in a different column, use the equivalent setting primary[n-1] where n equals the number of the column.
Documentation - https://docs.splunk.com/Documentation/Splunk/9.1.0/DashStudio/mapsChor
As per this, I modified my query to the one below and it worked
| fields+ country, count
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论