Generating Activity Logs

This ETL walkthrough provides an ETL starter sample for generating activity log files from the Ambience Server instance as the underlying MongoDB database housekeeps the collection regularly.

Download the sample ETL chainset here (1.8 KB). This chainset outputs from the LogActivities collection in the ambience-logs MongoDB database. Add the following to etc/application.conf to enable file writing to the /log directory, e.g. :

- Around lines 412, add the output path under "writable", e.g. "./log":
elixir.data.file {
  readable: ["./data/in", "./data/out"]
  writable: ["./data/out", "./log"]
}

- Around lines 439, add ambience-logs:
elixir.data.mongodb {
  default {
    connectionString = "mongodb://"${mongodb}":<port>"
    database {
      eno = "eno"
      samples = "samples"
      ambience = "ambience"
      ambience-logs = "ambience-logs"      
    }
  }
}
  1. Log in to the Ambience Server and upload the ETL chainset in the ETL module, open the chainset and select ‘Explain’ from the ‘Properties’ menu to view the details of each step in the ETL chainset

  2. This ETL chainset queries the previous day’s data from the LogActivities collection and writes out to, e.g. \log\yyyy-mm-dd\ActivityLogs.csv:

  3. You can schedule the ETL to run daily to get the previous day’s activity logs, e.g.:

Modify the ETL chainset accordingly to filter the activity log collection by date range, etc.