Skip to content
2023 API Summit Hackathon: Experiment with AI for APIs (August 28 - September 27) Learn More →
Kong Logo | Kong Docs Logo
search
  • We're Hiring!
  • Docs
    • Kong Gateway
      Lightweight, fast, and flexible cloud-native API gateway
      Kong Konnect
      Single platform for SaaS end-to-end connectivity
      Kong Mesh
      Enterprise service mesh based on Kuma and Envoy
      decK
      Helps manage Kong’s configuration in a declarative fashion
      Kong Ingress Controller
      Works inside a Kubernetes cluster and configures Kong to proxy traffic
      Kong Gateway Operator
      Manage your Kong deployments on Kubernetes using YAML Manifests
      Insomnia
      Collaborative API development platform
      Kuma
      Open-source distributed control plane with a bundled Envoy Proxy integration
  • API Specs
  • Plugin Hub
    • Explore the Plugin Hub
      View all plugins View all plugins View all plugins arrow image
    • Functionality View all View all arrow image
      View all plugins
      Authentication's icon
      Authentication
      Protect your services with an authentication layer
      Security's icon
      Security
      Protect your services with additional security layer
      Traffic Control's icon
      Traffic Control
      Manage, throttle and restrict inbound and outbound API traffic
      Serverless's icon
      Serverless
      Invoke serverless functions in combination with other plugins
      Analytics & Monitoring's icon
      Analytics & Monitoring
      Visualize, inspect and monitor APIs and microservices traffic
      Transformations's icon
      Transformations
      Transform request and responses on the fly on Kong
      Logging's icon
      Logging
      Log request and response data using the best transport for your infrastructure
  • Support
  • Community
  • Kong Academy
Get a Demo Start Free Trial
Kong Konnect
  • Home icon
  • Kong Konnect
  • Org Management
  • Audit Logging
  • Set up an audit log replay job
github-edit-pageEdit this page
report-issueReport an issue
  • Kong Gateway
  • Kong Konnect
  • Kong Mesh
  • Plugin Hub
  • decK
  • Kong Ingress Controller
  • Kong Gateway Operator
  • Insomnia
  • Kuma

  • Docs contribution guidelines
enterprise-switcher-icon Switch to OSS
On this pageOn this page
  • Prerequisites
  • Configure a replay job
  • View replay job
  • Replay job status
  • More information

Set up an audit log replay job

You can use the Konnect Audit Logs API to configure replay jobs for audit logging.

Replay jobs are useful when you have missed audit log entries due to an error or a misconfigured audit log webhook. You may have one replay job at a time per region, and request data from up to one week ago. A replay job in a region will resend data for the requested timeframe to the webhook configured for that region.

Prerequisites

Before you can request a replay job:

  • You must have Org Admin permissions.
  • Your audit log webhook must be enabled and ready to receive data.

Configure a replay job

Konnect UI
API
  1. From the navigation menu, open organizations icon Organization, then Audit Logs Setup.
  2. Switch to the Replay tab.
  3. Choose a timeframe for which you want to replay the logs.

    You can choose one of the preset relative increments for up to 24 hours, or set a custom timeframe for up to 7 days.

  4. Apply the timeframe, then click Send Replay.

Configure the replay job for a region by sending a PUT request to /audit-log-replay-job in the region where you want to retrieve data. The following example creates an audit-log-replay-job in the us region:

curl -i -X PUT https://global.api.konghq.com/v2/audit-log-replay-job \
    --header "Content-Type: application/json" \
    --header "Authorization: Bearer TOKEN" \
    --data '{"start_at":"2023-03-27T20:00:00Z","end_at":"2023-03-27T20:00:00Z"}'

Replace the following placeholders with your own data:

  • global.api.konghq.com: The region your org is in. Can be global to target all regions, us, or eu.
  • TOKEN: A Konnect personal access token or system account token.
  • start_at and end_at: Specify the timeframe for which you want to receive audit log events. start_at must be no more than seven days ago.

If the request is successful, you will receive a 202 response code and a response body containing the replay job details:

{
    "start_at":"2023-03-27T20:00:00Z",
    "end_at":"2023-03-27T20:00:00Z",
    "updated_at":"2023-03-31T11:34:18Z",
    "status":"accepted"
}

View replay job

Konnect UI
API
  1. From the navigation menu, open organizations icon Organization, then Audit Logs Setup.
  2. Switch to the Replay tab.
  3. Check the status table below the configuration field.

Audit log replay

You can view the audit log replay job in a given region by issuing a GET request. The following example retrieves an audit-log-replay-job in the us region:

curl https://global.api.konghq.com/v2/audit-log-replay-job \
    --header "Authorization: Bearer TOKEN"

You will receive a 200 response code and the job details:

{
    "start_at":"2023-03-27T20:00:00Z",
    "end_at":"2023-03-27T20:00:00Z",
    "updated_at":"2023-03-31T11:34:18Z",
    "status":"accepted"
}

Replay job status

A replay job can be in one of the following statuses:

  • unconfigured: Initial state. The job has not been set up.
  • accepted: The job has been accepted for scheduling.
  • pending: The job has been scheduled.
  • running: The job is in progress.
  • completed: The job has finished with no errors.
  • failed: The job has failed.

When a replay job is running, a request to update the job will return a 409 response code until it has completed or failed.

More information

  • Audit logging in Konnect
  • Set up an audit log webhook
  • Audit log event reference
  • Verify audit log signatures
  • Audit Logs API
Thank you for your feedback.
Was this page useful?
Too much on your plate? close cta icon
More features, less infrastructure with Kong Konnect. 1M requests per month for free.
Try it for Free
  • Kong
    THE CLOUD CONNECTIVITY COMPANY

    Kong powers reliable digital connections across APIs, hybrid and multi-cloud environments.

    • Company
    • Customers
    • Events
    • Investors
    • Careers Hiring!
    • Partners
    • Press
    • Contact
  • Products
    • Kong Konnect
    • Kong Gateway
    • Kong Mesh
    • Get Started
    • Pricing
  • Resources
    • eBooks
    • Webinars
    • Briefs
    • Blog
    • API Gateway
    • Microservices
  • Open Source
    • Install Kong Gateway
    • Kong Community
    • Kubernetes Ingress
    • Kuma
    • Insomnia
  • Solutions
    • Decentralize
    • Secure & Govern
    • Create a Dev Platform
    • API Gateway
    • Kubernetes
    • Service Mesh
Star
  • Terms•Privacy
© Kong Inc. 2023