Data Export

❗️

This service is now deprecated for our SaaS offering, please see our new Streaming Data Export service for up to date documentation.

Overview

LogRocket Data Export is purchasable as an add-on on top of your base contract. Contact LogRocket Support if you are interested in learning more.

LogRocket can automatically export session data into a file storage bucket for analysis. A single JSON Lines file (example) is created for each session when the session completes. A session is considered completed when no new data has been seen for over an hour. Session data available for export includes:

  • Metadata, including browser version, device type, and location data
  • User information from LogRocket.identify() calls, including auto-generated identifiers for anonymous sessions
  • Page navigation events
  • Click events
  • Mobile touch events
  • Input events
  • Custom events from LogRocket.track() calls, including any properties
  • JS errors
  • Network request and response events, including URL, method, headers, and status (bodies aren't included)
  • Redux action types (payloads aren't included)

Setup

If you're using the SaaS version of LogRocket, you shouldn't need to do anything to enable this feature other than speaking with LogRocket Support. Skip to the Usage section below.

If you're running LogRocket on-premise, enable this feature by adding the following to your values.yaml file:

dataExport:
  enabled: true

You will also need to configure a data export bucket under the existing buckets key:

buckets:
  dataExport: 'logrocket-data-export-<unique-id>'
  # ... existing keys you set up during initial deployment

Where <unique-id> is a string of your choosing. Your organization's name is a good choice. It should not contain any spaces.

After filling in these new values, run a regular upgrade to apply the changes to your instance.

Usage

Exported sessions should start to show up after about an hour. You can then use the LogRocket API to get a list of export files. To do this, you'll need your API key. You can find your API key in the dashboard under Settings > General Settings. Also note that the hostname of the LogRocket API varies depending on whether you're using SaaS or on-premise. The examples below use the SaaS hostname, api.logrocket.com. The on-premise hostname is determined by the domains.api field in your values.yaml (e.g., logrocket.example.com).

Once you have your API key, make a request to the LogRocket data export API:

curl https://api.logrocket.com/v1/orgs/<your-org>/apps/<your-app>/data-export/ -H 'Authorization: token <your-api-key>'

This request will return an object similar to the following:

{
  cursor: 1530651654308,
  sessions: [
    { url: "https://storage.example.com/file-1" },
    { url: "https://storage.example.com/file-2" }
  ]
}

The returned sessions will be your oldest exported sessions.

Pagination

The returned cursor can be used to retrieve the next page (newer sessions). You can also limit the number of returned values using the limit query parameter. The default size per page is 10and maximum size per page is 100.

curl 'https://api.logrocket.com/v1/orgs/<your-org>/apps/<your-app>/data-export/?cursor=1530651654308&limit=10' -H 'Authorization: token <your-api-key>'

Please treat the cursor as a string. It is not guaranteed to be a number.

Time Offsets

To get a list of sessions starting at a specific time, pass the date query string with a Unix timestamp in milliseconds:

curl 'https://api.logrocket.com/v1/orgs/<your-org>/apps/<your-app>/data-export/?date=1530651654308' -H 'Authorization: Token <your-api-key>'

What’s Next

See our new Streaming Data Export service!