循环通过查询以拉动KQL/Grafana中的子字样?
因此,我需要从Grafana中的查询中从以下数据中获取一些子字符串,
[
{
"rel": "System.LinkTypes.Hierarchy-Forward",
"url": "https://fakelink/workItems/247155",
"attributes": {
"isLocked": false,
"name": "Child"
}
},
{
"rel": "System.LinkTypes.Hierarchy-Forward",
"url": "https://fakelink/workItems/247154 ",
"attributes": {
"isLocked": false,
"name": "Child"
}
},
{
"rel": "System.LinkTypes.Hierarchy-Forward",
"url": "https://fakelink/247160",
"attributes": {
"isLocked": false,
"name": "Child"
}
},
{
"rel": "System.LinkTypes.Hierarchy-Forward",
"url": "https://fakelink/247156",
"attributes": {
"isLocked": false,
"name": "Child"
}
},
{
"rel": "System.LinkTypes.Hierarchy-Forward",
"url": "https://fakelink/workItems/247159",
"attributes": {
"isLocked": false,
"name": "Child"
}
},
{
"rel": "System.LinkTypes.Hierarchy-Forward",
"url": "https://fakelink/workItems/247157",
"attributes": {
"isLocked": false,
"name": "Child"
}
},
{
"rel": "System.LinkTypes.Hierarchy-Forward",
"url": "https://fakelink/247158",
"attributes": {
"isLocked": false,
"name": "Child"
}
}
]
这显然在表中有那根长字符串对我来说是没有用的。我需要以某种方式解析数据,并在每个Web链接的末尾以及“孩子”短语中拉出数字,并以某种方式将这些短语(或者选择为子列(或该位置上的任何短语))与末尾的数字连接起来网络链接是表中的数据。有人告诉我我需要“写一个循环以浏览JSON”,根本没有任何帮助,建议,任何内容,都会非常理解
:琴弦在每个项目中都不同,查询已拉起,有几千个。
So I need to pull the some substrings from the following data from a query
[
{
"rel": "System.LinkTypes.Hierarchy-Forward",
"url": "https://fakelink/workItems/247155",
"attributes": {
"isLocked": false,
"name": "Child"
}
},
{
"rel": "System.LinkTypes.Hierarchy-Forward",
"url": "https://fakelink/workItems/247154 ",
"attributes": {
"isLocked": false,
"name": "Child"
}
},
{
"rel": "System.LinkTypes.Hierarchy-Forward",
"url": "https://fakelink/247160",
"attributes": {
"isLocked": false,
"name": "Child"
}
},
{
"rel": "System.LinkTypes.Hierarchy-Forward",
"url": "https://fakelink/247156",
"attributes": {
"isLocked": false,
"name": "Child"
}
},
{
"rel": "System.LinkTypes.Hierarchy-Forward",
"url": "https://fakelink/workItems/247159",
"attributes": {
"isLocked": false,
"name": "Child"
}
},
{
"rel": "System.LinkTypes.Hierarchy-Forward",
"url": "https://fakelink/workItems/247157",
"attributes": {
"isLocked": false,
"name": "Child"
}
},
{
"rel": "System.LinkTypes.Hierarchy-Forward",
"url": "https://fakelink/247158",
"attributes": {
"isLocked": false,
"name": "Child"
}
}
]
In grafana obviously having that long string in a table is useless to me. I need to somehow parse the data and pull the number at the end of each web link as well as the "Child" phrases and somehow connect those preferably as a Child column (or whatever phrase is in that spot) with the numbers at the end of the web links being the data in the table. I was told I needed to "write a loop to go through the JSON" any help at all, suggestions, anything, would be massively appreciated
note: the string is different for every single item the query pulled up and there's a couple thousand
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
mv-expander阵列。
parse 操作员,以从每个URL。
mv-expand operator, to explode the array.
parse operator, to extract the number from each url.
Fiddle