01-03-2020 06:29 AM
I am trying to come up with some monitoring for interfaces with DHCP address. I see the API has the ability to watch the events field but I am struggling with the query to filter events down to "dhcp-address-renewed".
Here is the API call I am playing with just need help with query part.
curl -k --silent --user USER:****** "https://X.X.X.X/dataservice/events?query=????"
Any help would be great.
Thanks
01-05-2020 08:01 PM
01-05-2020 08:02 PM
Please use the API URL : https://<vmanage-ip>/dataservice/event
Method : POST request
POST request Query payload (JSON format): ( This query rule returns the dhcp address renewed events for last 3 hours however we can change the value in the query rule as per requirement)
{
"query": {
"condition": "AND",
"rules": [
{
"value": [
"3"
],
"field": "entry_time",
"type": "date",
"operator": "last_n_hours"
},
{
"value": [
"dhcp-address-renewed"
],
"field": "eventname",
"type": "string",
"operator": "in"
}
]
},
"size": 10000
}
Please let me know if you face any issues in using the above sample query to get dhcp address renewal events.
For more information on simple query apis please check : https://sdwan-docs.cisco.com/Product_Documentation/Command_Reference/Command_Reference/vManage_REST_APIs/vManage_REST_APIs_Overview/vManage_Simple_Query
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide