modality delete

Command: modality delete <<timeline filter expression> | <ingest edge id>>

Delete some set of data from modality's database. You can provide either an ingest edge ID or a timeline filter expression to denote the data to be deleted. By default this command will only delete data visible from the current segment(s) of the current workspace. To delete data from outside these constraints pass the --global option.

Ingest edge IDs are assigned and printed each time you collect data to modality with either the modality-reflector run or modality-reflector import commands. They are not accessible anywhere else, so you should note the ingest edge ID for any operation you may want to remove from modality's database later.

# Example

$ modality delete -49112361736196256116957387383561298965
Completed dry run of timelines-with-events deletion:
	Timeline filter '_.timeline.ingest_edge_id = -49112361736196256116957387383561298965' over a workspace at version 8aa8b23b-f8b0-4fd2-9a03-1fae4788bf36
	Found 1 timeline containing a total of 865 events
Are you sure you want to delete this data? (yes/no)
yes
Deletion done:
	Timeline filter '_.timeline.ingest_edge_id = -49112361736196256116957387383561298965' over a workspace at version 8aa8b23b-f8b0-4fd2-9a03-1fae4788bf36
	Deleted 1 timeline containing a total of 865 events

$ modality delete "_.name = 'producer' OR _.name = 'consumer'" --global
Completed dry run of timelines-with-events deletion:
	Timeline filter '_.name = 'producer' OR _.name = 'consumer'' over all data globally available
	Found 4 timelines containing a total of 235 events
Are you sure you want to delete this data? (yes/no)
yes
Deletion done:
	Timeline filter '_.name = 'producer' OR _.name = 'consumer'' over all data globally available
	Deleted 4 timelines containing a total of 235 events

# Options

<timeline filter expression> - An expression to select timelines for deletion. Mutually exclusive with <ingest edge id>. This expression is based on timeline attributes and has the following features:

  • All attribute names must be prefixed with _..
  • You may use the following operators: -, +, *, /, =, !=, AND, OR.
  • Right hand values to = and != use glob matching. * matches any number of characters, ? matches any single character.
  • You may use exists(_.attribute) to require that a given attribute be present on the timeline.

A few examples:

  • "_.name = 'debug'"
  • "_.unit = 'drone2' AND _.mission = 'test-suite-*'"
  • "exists(_.sensor-id)"
  • "_.name = 'error-stream' AND _.debug-level > 2"

<ingest edge id> - ID provided by the modality-reflector command used to collect the data, either modality-reflector run or modality-reflector import. These commands print the ingest edge ID at the top of their output. It is not accessible at any other time, so you should note the ingest edge ID for any operation you may want to remove from modality'd database later.

--dry-run - Just print information about what data would be deleted without offering the option to proceed with deletion.

--force - Bypass the user confirmation check and immediately delete the targeted data.

-f, --format <text | json> - The printed output format. Defaults to text.

--global - Delete timelines from modality's entire database. If this flag is not present deleted timelines are limited to those visible from the current segment(s) of the current workspace. May not be used with --latest-segment, --segment, --segmentation-rule, or --whole-workspace.

--latest-segment - Limit data to the single most recent segment (i.e. the segment which has most recently received an event or timeline attribute update). The latest segment is automatically updated as new data are received. May not be used with --global, --segment, --segmentation-rule, or --whole-workspace.

--segment <segment>... - Limit data to the given segment(s). Accepts one or more segment name patterns, which can include * or ? as wildcards in the style of glob. May not be used with --global, --latest-segment, or --whole-workspace.

--segmentation-rule <segmentation rule>... - Limit data to segments produced by the given segmentation rule(s) rather than the current default segment(s). Accepts one or more segmentation rule name patterns, which can include * or ? as wildcards in the style of glob. May not be used with --global, --latest-segment, or --whole-workspace.

--whole-workspace - Limit data to the workspace as a monolithic whole unit, ignoring the default segment(s). May not be used with --global, --latest-segment, --segment, or --segmentation-rule.

--workspace-name <workspace-name> - Name of the workspace to delete data from. If not specified the current default workspace (set with modality workspace use) will be used.