cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
874
Views
0
Helpful
2
Replies

vManage API Event Query

JoshuaKoll5207
Level 1
Level 1

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
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
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