Tracking user activity in a stream

It is possible to automate the process of tracking user activity in a stream. The following script will automate this process via a configuration file, plus some work with the authentication keys, a Service Account and a StreamIDThe full script can be viewed and downloaded from repository located here.

Important notes:

  • This script uses Python, please install this before attempting to run the script.
  • This script takes an optional since argument (epoch timestamp) to search within a given timeframe. The script by default searches the last 7 days of stream activity.
  • This is an unsupported script which has been developed for users as a guideline to adapt accordingly.

To use the script:

  1. Install the Python SDK file using the pip command:

mceclip0.png

You are required to have the following items which are passed through to the script to ensure it is executed successfully:

  • RSA key pair: Must be obtained from your internal IT team, as Symphony does not administer your instance. Alternatively, you may be able to create an RSA key pair as described here.

  • config.yaml: This is required in the following format:

host: companyabc.symphony.com # your own pod host name
bot:
username: BOT-USERNAME # your service account username
privateKey:
path: /path/to/bot/rsa-private-key.pem # your bot RSA private key
    • companyabc is the name of your Symphony instance.
    • Further information on BDK configuration can be found here.
  1. Navigate to the working directory and run the following command:
python streamactivity.py --config /path/to/config.yaml --stream "stream_id"

A stream/conversationID will need to be URL Safe Base64 encoded for the APIs in the script to function. Further information about this can be found here.

  1. If a specific timeframe is required, the following command can be used accordingly:
python streamactivity.py --config /path/to/config.yaml --since epoch_timestamp --stream "stream_id"
  1. Configuring logging is an optional step to run this script, but it can be useful for debugging purposes. If you wish to do this, uncomment lines 13-15 in streamactivity.py and create the following file and directory within the working directory:

mceclip1.png