Hi,
I was trying the below token logic to get the results count from two different panels and find the variance between results. However, it gives error message as in snapshot.
Note: Panel A and Panel B i have enabled the set token ( basically tic marked "Use search results or job status as tokens")
Also, please suggest how to draw line not just horizontally but also vertically or custom?
SPL:
| makeresults
| eval variance=$A:result.count$ - $B:result.count$
| table variance
Error:
Thanks,
Selvam.
Are you trying to achieve something similar?
Here is a run anywhere example . Number input is only to change the value in the A box for demonstration
{
"visualizations": {
"viz_mP9NTc6l": {
"type": "splunk.singlevalue",
"options": {
"trendColor": "#171d21",
"backgroundColor": "#dc4e41"
},
"dataSources": {
"primary": "ds_uCpsCnrn"
}
},
"viz_5qfKAE2H": {
"type": "splunk.singlevalue",
"options": {
"backgroundColor": "#b6c75a"
},
"dataSources": {
"primary": "ds_s5yiPOpw_ds_uCpsCnrn"
}
},
"viz_lwpeyQcS": {
"type": "splunk.singlevalue",
"options": {
"backgroundColor": "#62b3b2"
},
"dataSources": {
"primary": "ds_6iVMrVEi_ds_s5yiPOpw_ds_uCpsCnrn"
}
},
"viz_P6dRCwGc": {
"type": "abslayout.line"
},
"viz_jTW6Jy5J": {
"type": "abslayout.line"
}
},
"dataSources": {
"ds_uCpsCnrn": {
"type": "ds.search",
"options": {
"enableSmartSources": true,
"query": "| makeresults count=$number$\n| stats count"
},
"name": "A"
},
"ds_s5yiPOpw_ds_uCpsCnrn": {
"type": "ds.search",
"options": {
"enableSmartSources": true,
"query": "| makeresults count=5\n| stats count"
},
"name": "B"
},
"ds_6iVMrVEi_ds_s5yiPOpw_ds_uCpsCnrn": {
"type": "ds.search",
"options": {
"enableSmartSources": true,
"query": "| makeresults\r\n| eval variance=$A:result.count$ - $B:result.count$\r\n| table variance"
},
"name": "Variant"
}
},
"defaults": {
"dataSources": {
"ds.search": {
"options": {
"queryParameters": {
"latest": "$global_time.latest$",
"earliest": "$global_time.earliest$"
}
}
}
}
},
"inputs": {
"input_global_trp": {
"type": "input.timerange",
"options": {
"token": "global_time",
"defaultValue": "-24h@h,now"
},
"title": "Global Time Range"
},
"input_vWVKiJlJ": {
"options": {
"defaultValue": 10,
"token": "number"
},
"title": "Number Input Title",
"type": "input.number"
}
},
"layout": {
"type": "absolute",
"options": {
"width": 1440,
"height": 960,
"display": "auto"
},
"structure": [
{
"item": "viz_mP9NTc6l",
"type": "block",
"position": {
"x": 410,
"y": 170,
"w": 150,
"h": 100
}
},
{
"item": "viz_5qfKAE2H",
"type": "block",
"position": {
"x": 680,
"y": 170,
"w": 150,
"h": 100
}
},
{
"item": "viz_lwpeyQcS",
"type": "block",
"position": {
"x": 520,
"y": 370,
"w": 150,
"h": 100
}
},
{
"item": "viz_P6dRCwGc",
"type": "line",
"position": {
"from": {
"x": 483,
"y": 274
},
"to": {
"item": "viz_lwpeyQcS",
"port": "n"
}
}
},
{
"item": "viz_jTW6Jy5J",
"type": "line",
"position": {
"from": {
"x": 756,
"y": 272
},
"to": {
"item": "viz_lwpeyQcS",
"port": "n"
}
}
}
],
"globalInputs": [
"input_global_trp",
"input_vWVKiJlJ"
]
},
"description": "",
"title": "Variance_Test"
}