Application Insights获取原始文本。

huangapple go评论46阅读模式
英文:

Application Insights get raw text

问题

当我在应用程序洞察 (来自门户) 上使用 KQL 运行查询时,我会得到一堆列。是否有任何函数/查询或格式,我可以应用以获取原始文本。我只需要结果中每个项目的原始文本。这样我就可以复制并查询文本。也许我有点守旧,但我不喜欢应用程序洞察的列视图 Application Insights获取原始文本。

exceptions
| where timestamp > ago(24h)
| summarize Count=count() by type
| sort by Count desc
| take 5
| join kind=inner (
   exceptions
   | where timestamp > ago(24h)
) on type
英文:

When I run a query with KQL on Application Insights (from the portal).
Say

exceptions
| where timestamp > ago(24h)
| summarize Count=count() by type
| sort by Count desc
| take 5
| join kind=inner (
   exceptions
   | where timestamp > ago(24h)
) on type

I get a bunch of columns. Is there any function/query or format that I can apply to get the raw text. I just need the raw text of each item in the result. So I can copy and query the text. Maybe I'm old school but I don't like the Application Insights column view Application Insights获取原始文本。

exceptions
| where timestamp > ago(24h)
| summarize Count=count() by type
| sort by Count desc
| take 5
| join kind=inner (
exceptions
| where timestamp > ago(24h)
) on type

答案1

得分: 1

我同意 @Jason Evans 的看法,如果你正在使用Azure应用洞察,你会得到以下表格格式的日志:

Application Insights获取原始文本。

如果你想要单独的列,可以使用以下查询:

exceptions
| where timestamp > ago(30d)
| summarize Count=count() by type
| sort by Count desc
| take 5
| join kind=inner (
   exceptions
   | where timestamp > ago(30d)
) on type
| project method

在这里,我使用 project 获取所需的列。
Kql 是 Kusto 查询语言,以表格格式获取信息,所以无法获取原始文本。
如果你想要将日志导出到文件中,你可以将日志导出到存储帐户,就像这里所示,然后你将获得一个日志文件。

英文:

I do agree with @Jason Evans, that if you are using Azure Application insights, you will get logs in a table format like below:

Application Insights获取原始文本。

If you want individual column you can use below query:

exceptions
| where timestamp > ago(30d)
| summarize Count=count() by type
| sort by Count desc
| take 5
| join kind=inner (
   exceptions
   | where timestamp > ago(30d)
) on type
| project method

Application Insights获取原始文本。

Here I am using project to get required column.
Kql is Kusto query language which gets information in table format so raw text is not possible to get.
If you want logs in a file then you can export the logs to storage account like this and then you will get a log file.

huangapple
  • 本文由 发表于 2023年6月15日 19:55:03
  • 转载请务必保留本文链接:https://go.coder-hub.com/76482205.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定