"rawSql":"SELECT\n $__timeGroup(timestamp, $__interval) as time,\n count(*) as count,\n CASE WHEN iswithdrawn THEN 'WITHDRAWN' ELSE 'ACTIVE' END as metric\nFROM\n ls_links_log\nWHERE\n $__timeFilter(timestamp)\n AND peer_hash_id = '$peer_hash'\nGROUP BY time,metric\nORDER BY time\n\n",
"refId":"A",
"select":[
[
{
"params":[
"value"
],
"type":"column"
}
]
],
"timeColumn":"time",
"where":[
{
"name":"$__timeFilter",
"params":[],
"type":"macro"
}
]
}
],
"title":"Link Changes",
"type":"timeseries"
},
{
"datasource":{
"type":"postgres",
"uid":"obmp_postgres"
},
"fieldConfig":{
"defaults":{
"color":{
"mode":"thresholds"
},
"custom":{
"align":"auto",
"displayMode":"auto",
"filterable":true,
"inspect":false
},
"mappings":[],
"thresholds":{
"mode":"absolute",
"steps":[
{
"color":"green",
"value":null
}
]
},
"unit":"none"
},
"overrides":[
{
"matcher":{
"id":"byName",
"options":"seq"
},
"properties":[
{
"id":"unit",
"value":"locale"
}
]
},
{
"matcher":{
"id":"byName",
"options":"timestamp"
},
"properties":[
{
"id":"unit",
"value":"time: YYYY-MM-DD HH:mm:ss.SSS"
}
]
},
{
"matcher":{
"id":"byName",
"options":"state"
},
"properties":[
{
"id":"custom.displayMode",
"value":"color-background-solid"
},
{
"id":"mappings",
"value":[
{
"options":{
"ACTIVE":{
"color":"semi-dark-green",
"index":0
},
"WITHDRAWN":{
"color":"semi-dark-red",
"index":1
}
},
"type":"value"
}
]
}
]
}
]
},
"gridPos":{
"h":14,
"w":24,
"x":0,
"y":8
},
"id":2,
"options":{
"footer":{
"fields":"",
"reducer":[
"sum"
],
"show":false
},
"showHeader":true
},
"pluginVersion":"8.5.4",
"targets":[
{
"format":"table",
"group":[],
"metricColumn":"none",
"rawQuery":true,
"rawSql":"SELECT\n l.timestamp,\n l.seq,ln.name as LocalNode, rn.name as RemoteNode, l.mt_id,l.igp_metric,CASE WHEN l.iswithdrawn THEN 'WITHDRAWN' ELSE 'ACTIVE' END as state\nFROM\n ls_links_log l JOIN ls_nodes ln ON (l.local_node_hash_id = ln.hash_id and l.peer_hash_id = ln.peer_hash_id) \n JOIN ls_nodes rn ON (l.remote_node_hash_id = rn.hash_id and rn.peer_hash_id = l.peer_hash_id)\nWHERE\n $__timeFilter(l.timestamp)\n AND l.peer_hash_id = '$peer_hash'\n",
"definition":"SELECT __text,__value FROM (\n select peername as __text, peer_hash_id as __value, count(*) as count\n from v_ls_nodes\n group by peername,peer_hash_id) d\nwhere count > 0",
"hide":0,
"includeAll":false,
"label":"BGP Peer",
"multi":false,
"name":"peer_hash",
"options":[],
"query":"SELECT __text,__value FROM (\n select peername as __text, peer_hash_id as __value, count(*) as count\n from v_ls_nodes\n group by peername,peer_hash_id) d\nwhere count > 0",