Monitoring account activity with the audit log

      Last updated May 20, 2020

    The audit log keeps track of events related to your account, users, and services. You can use the audit log to determine which changes were made and by whom. For example, you can use the audit log to:

    You can use the web interface and the Fastly API to view the audit log.

    Accessing the audit log via the web interface

    You must be assigned the role of superuser to view the audit log. Follow these instructions to access the audit log for your account:

    1. Log in to the Fastly web interface and click the Account link from the user menu. Your account information appears.
    2. Click the Audit log link. The Audit log page appears.

      Audit log example

    Accessing the audit log via the API

    The /events API endpoint can be used to retrieve an account's audit log. You can filter these events by user_id, service_id, customer_id, and event_type. For example, you could make the following API call in a terminal application to view all recent events:

    1
    
    curl -g -H "Fastly-Key: FASTLY_API_TOKEN" "https://api.fastly.com/events?filter[customer_id]=x4xCwxxJxGCx123Rx5xTx&page[number]=1&page[size]=1"
    

    The response will look like this:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    
    {
      "data": [
          {
              "attributes": {
                  "admin": false,
                  "created_at": "2016-06-06T20:05:10Z",
                  "customer_id": "x4xCwxxJxGCx123Rx5xTx",
                  "description": "Version 2 was activated",
                  "event_type": "version.activate",
                  "ip": "127.0.0.0",
                  "metadata": {
                      "version_number": 2
                  },
                  "service_id": "SU1Z0isxPaozGVKXdv0eY",
                  "user_id": "4Pp0BW3UkBEJhG3N0kovLP"
              },
              "id": "5IH1QmNSV1Qi7jXc4oIZlZ",
              "type": "event"
          }
      ],
      "links": {
        "last": "https://api.fastly.com/events?filter[customer_id]=x4xCwxxJxGCx123Rx5xTx&page[number]=1&page[size]=1"
      }
    }
    

    See the API documentation for more information.

    Back to Top