Configuring Syslog Settings on Edge Gateway in vCloud Air via Rest API

Recently I deployed syslog server in my vCloud Lab and was looking for a way to send Edge gateway logs to my syslog server. This post in focused on how to configure edge gateway syslog settings. 

VMware vCloud® Air supports the ability for customers to collect information about traffic coming to and from their edge gateway through the use of a syslog server. By configuring edge gateway to transfer log data to your syslog server, you can then set up alerts or notifications and build reports with your preferred tools.

If you do not have ANS subscription in vCloud Air then the only way to configure syslog settings on the Edge gateway is via vCloud API. There is no option available in GUI when you open edge gateway properties from within vCloud Director interface.

When it comes to using Rest API we have variety of choice to use as Rest Client. Some of the common clients include curl, Postman,Mozilla rest Client etc.

I personally prefers curl and postman and in this post I will demonstrate the curl option.

Requirements to Configure Syslog on Edge Gateway:

1: A REST client.

2: vCloud Air credentials.

3: vCloud Air Endpoint/Org name.

4: Configured syslog server and IP address.

Obtaining vCloud Air Endpoint/Org name

You can obtain the endpoint details by logging into vCloud Air portal and navigating to your Org/vDC.

Obtaining vCloud Air supported API versions

List of supported API versions that can be used with vCloud Air can be obtained by firing below command. 

# curl -sik -H “Accept:application/*+xml;version=5.6” -u “” -X GET

You will get a long list of versions as output. Select any one of the version. Also make a note of the login URL. 

Obtaining Auth Code for vCloud API Login

You need 4 things for generating Auth code for API login

A: Login URL (copy from previous output)

B: API Version: (copy from previous output)

C: Customer Header: Accept:application/*+xml;version=9.0

D: vCloud Air Credentials in format: username@domain-name@org-name

When you have all the 4 info handy, fire below API query to obtain Auth code

# curl -sik -H “Accept:application/*+xml;version=9.0” -u “” -X GET | grep auth

Enter host password for user ‘’:

Post entering password, you will be provided with Auth token

x-vcloud-authorization: 1e95dc1064aa4083ae79bb617221853e

Now use following API queries in sequence

Find Org UUID

# curl -sik -H “Accept:application/*+xml;version=5.6” -H “x-vcloud-authorization:1e95dc1064aa4083ae79bb617221853e” -X GET | grep bdd75fd4-a319-47d5-b4f2-77aad691488f    

Note: bdd75fd4-a319-47d5-b4f2-77aad691488f is my org name.

You will get the org href in the output


# curl -sik -H “Accept:application/*+xml;version=5.6” -H “x-vcloud-authorization:1e95dc1064aa4083ae79bb617221853e” -X GET | grep vdc

List all edge gateways in your Org

# curl -sik -H “Accept:application/*+xml;version=5.6” -H “x-vcloud-authorization:1e95dc1064aa4083ae79bb617221853e” -X GET | grep edge

Find Edge Gateway UUID

# curl -sik -H “Accept:application/*+xml;version=5.6” -H “x-vcloud-authorization:1e95dc1064aa4083ae79bb617221853e” -X GET | grep EdgeGatewayRecord

Once you obtain the edge UUID we need to update the edge by supplying a custom xml file which will enable the syslog settings. 

First create an xml file with below content

Now execute below API call to configure the syslog settings.

# curl -sik -H “Accept:application/*+xml;version=5.6” -H “Content-Type:application/*+xml” -H “x-vcloud-authorization:1e95dc1064aa4083ae79bb617221853e” -X POST -d @syslog.xml

You should see a Http 202  Accepted in output and the task details

HTTP/1.1 202 Accepted Date: Sun, 06 Aug 2017 06:28:55 GMT

Open the edge gateway properties again and verify syslog server IP is now present.

On my syslog server I can see log files getting populated

[root@syslogsrv vse-40b96734-3311-48ea-9b91-a34cf2efc0bc-0]# ls
config.log firewall.log monit.log syslog-ng.log

Also in /var/log/messages I can see log entries from edge gateway

Additional Sources

Configure Syslog Settings on vCloud Air Edge Gateway


I hope you enjoyed reading this post. Feel free to share this on social media if it is worth sharing. Be sociable