Discover Labels - Exporting Labels from a test environment to production

Labels are useful in Discover: to remove data from the database, to eliminate the noise from your view, to group common items together or to alert on these items.

Importing labels in Tanium Discover from a test environment to production has historically always been a pain: a label created in one environment could not be moved to another. As with all things Tanium, best practice is to test then move to production, but in the case of labels it involved a full scale re-implementation which doubled the work and could introduce errors.

Discover 2.11 introduced the concept of exportable and importable labels: the goal was to provide portability of labels. The following steps will show how to use this functionality:

Create a label as you normally would (or use one you have already created) and press the Export button while editing any label:


DiscLabelsExpor_d52b68b1-b3e7-4516-845c-c36bf8acecb5.png

This will create a JSON file for you which you can then import to any other environment:

--------------------------------HP Printers JSON--------------------------------------- {  "version": "1",  "items": [   {    "name": "HP Printers",    "rules": [     {      "field": "Manufacturer",      "op": "contains",      "value": "Hewlett",      "value1": ""     },     {      "include": "AND"     },     {      "field": "open ports",      "op": "contains",      "value": "9100",      "value1": ""     }    ],    "activity": "LABEL"   }  ] } --------------------------------HP Printers JSON---------------------------------------

Also you can export all of your labels into a single JSON file for easy backup or migration from the main Interface Labels screen:


DiscLabelsExpor_5b03e58c-30dc-4c06-8819-e78d9627a9de.png

And finally -  if you are importing, you can import the JSON file at the Interface Labels screen. This is one JSON file but can contain one or more labels:


DiscLabelsExpor_e03e20ce-0fbd-4f25-ab16-f2216d785352.png

To clarify, this method of exporting and migrating labels is available in version 2.11 and beyond of Tanium Discover.