aws_byline - bruno-beloff/scs_analysis GitHub Wiki

docs > software repositories > scs_analysis > commands > retrieving historic data


DESCRIPTION

The aws_byline utility is used to find the date / time of the most-recently published message for a given topic or device. The user may specify a topic path (find all devices that have published to the given topic), or a device tag (find all topics which the given device has published to), but not both. A further option --all reports all bylines.

Output is in the form of zero or more JSON documents, indicating the device, topic and localised date / time for each latest sense event.

Note that deleting a device / topic pair does not affect the topic messages - the corresponding messages should be deleted using the scs_lambda aws_message_delete utility as required.

The --credentials flag is only required where the user wishes to store multiple identities. Setting the credentials is done interactively using the command line interface.

SYNOPSIS

aws_byline.py [-c CREDENTIALS] { -F { -d DEVICE | -t TOPIC [-l] | -a } [-x EXCLUDED] [-s] [-m] | -D DEVICE TOPIC } [-i INDENT] [-v]

Options
--version show program's version number and exit
-h, --help show this help message and exit
-c CREDENTIALS_NAME, --credentials=CREDENTIALS_NAME the stored credentials to be presented
-F, --find find bylines
-D DELETE, --delete=DELETE delete TOPIC for DEVICE (superuser only)
-d DEVICE, --device=DEVICE report bylines for DEVICE
-t TOPIC, --topic=TOPIC report bylines for TOPIC
-a, --all report all bylines
-x EXCLUDED, --excluded=EXCLUDED exclude topics ending with EXCLUDED
-s, --strict only report devices with valid tags
-l, --latest only report the most recent byline
-m, --include-messages report the message with each byline
-i INDENT, --indent=INDENT pretty-print the output with INDENT
-v, --verbose report narrative to stderr

EXAMPLES

aws_byline.py -t south-coast-science-demo -v -x /control

DOCUMENT EXAMPLE - OUTPUT

{"device": "scs-bgx-401", "topic": "south-coast-science-demo/brighton/loc/1/particulates", "pub": "2020-09-25T11:49:46Z", "rec": "2020-09-25T11:49:40Z"}

SEE ALSO

scs_analysis/aws_topic_history
scs_analysis/aws_topic_origin
scs_analysis/cognito_user_credentials

scs_lambda/aws_message_delete