cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements

Choose one of the topics below for SD-WAN Resources to help you on your journey with SD-WAN

This community is for technical, feature, configuration and deployment questions.
For production deployment issues, please contact the TAC!
We will not comment or assist with your TAC case in these forums.

455
Views
0
Helpful
2
Replies
JoshuaKoll5207
Beginner

vManage API Event Query

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

2 REPLIES 2
msuchand
Cisco Employee

Hi,

Please use the API URL : https:///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

Thanks,
Sai
msuchand
Cisco Employee

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

 

Content for Community-Ad