Reference: Source field mapping options

Important: The option to map additional fields is a beta feature. By default, field mapping is available to legacy versions of the Import API source. To enable field mapping for AWS, Microsoft Azure, Microsoft Intune, and Google sources, Contact Tanium Support.

In addition to the default field mappings for each custom source, you can configure additional field mappings. Each field mapping must specify how to map attributes in the source to attributes in the Asset database. Use this reference to understand the available options when you configure field mappings.

Note: Consider the data type when you map fields. In most cases, data is converted automatically to the appropriate data type before adding it to the Asset database. If Asset cannot convert data into the selected data type, the data is ignored. For example, if you attempt to map a string field in the source with a value of Hello World to an integer field in the Asset database, the incoming data is ignored.

Map additional fields for a source

In addition to the default field mappings for each custom source, you can configure custom field mappings.

Before you begin

  • You must first create the source before you configure additional field mappings.

  • To map a source field to an Asset entity, the field must exist in the source and the entity must exist in Asset. For more information about how to configure custom entities and attributes in Asset, see Configure additional Tanium entities and attributes.

  • To map an array of values in the source schema to an entity in Asset, use a multiple-row Asset entity. To map a single field in the source schema, use a single-row Asset entity. You must have a role with the Asset Configuration Item write permission to edit sources. Users assigned the Asset Operator reserved role have this permission.

  • You must have access to the field schema from the source, and you should understand how to navigate the schema using dot-notation syntax. For more information about how to use dot-notation when mapping fields, see Dot-notation syntax.

Steps

  1. From the Main menu, go to Modules > Asset > Inventory Management > Sources.

  2. In the row of the source that you want to edit, click Edit edit2.

  3. Go to the Field Mappings section and click Add Entity Field Mapping.

    The Field Mappings section contains the default field mappings for the source in addition to any custom field mappings. The section only appears when you edit the source.

  4. From the Add Entity Field Mapping dialog, select the Asset entity to which you want to map a field from the source.

  5. If you selected an entity that contains multiple rows per endpoint, enter the path to the array in the source schema in the Source Array Path field, and then select the Attribute to Edit.

    Tip: To reset any configuration settings for Source and Convert Operations, click Delete trash_button next to Attribute to Edit.
  6. To map the value in the schema to the Asset attribute, enter the path to the field in the schema in the Source field and ensure Path is selected. If you selected an entity with multiple rows per endpoint, you only need to enter the path starting from the path specified in the Source Array Path field. Specify paths in dot-notation format. For more information, see Dot-notation syntax.

    Note: You can also choose to map a constant value to the Asset attribute. Enter the value in the Source field and then select Static Value.
  7. For the Source field, choose one of the following:

    • To map the value in the schema to the Asset attribute, select Path and then enter the path to the field in the schema in the Source field. If you selected an entity with multiple rows per endpoint, you only need to enter the path starting from the path specified in the Source Array Path field.

    • To map a constant value to the Asset attribute, select Static Value and enter the value in the Source field.

  8. (Optional) To augment the data from the source, add convert operations.

    Note: The option to add convert operations is not available if you select Static Value for the Source field.
    1. Click Add Convert Operation.

    2. Select the type of convert operation and then enter a value for the operation.

      Convert Operation

      Description

      Append

      Enter a value to append to the data.

      Array Length

      When the field that you specified in the Source field is an array, returns the length of the array

      Lowercase

      Convert all characters in the data to lowercase.

      Replace

      Match a regular expression in the data and then enter the replacement value.

      Prefix

      Enter a value to prepend to the data.

      For more information about these convert operations, see Convert operations.

    3. Repeat to add any additional convert operations.

    4. (Optional) If you add multiple operations, drag the operations to change the order in which the operations occur.

  9. When finished, click Save Changes.

The field mapping is immediately applied to the source; you do not need to save the source to save the new field mapping.

Tip: If you map a field to an attribute in a custom entity, and you later want to delete the attribute or custom entity, you must first remove the field mapping from the source. When you attempt to delete an attribute, Asset shows a list of references to the attribute from all reports, views, permissions, sources, and ServiceNow destinations. For more information about how to delete attributes, see Delete attributes.

What to do next

Import the source to verify the field mapping performs as expected. For more information, see Test field mappings.

Convert operations

The following convert operations are available when you configure additional field mapping. Convert operations are only available when the Source value contains a path. For more information, see Map additional fields for a source.

Note: Some convert operations are limited by the data type of the Asset field. For example, if the Asset field is an integer, you can only prefix or append numbers to the incoming data.
Tip: You can add multiple convert operations to a single field mapping, and you can customize the order of the convert operations. When using any convert operations, consider using test data to verify the data is converted as intended.
Append

Enter a value to append to the data.

For example, if you select to append GB to the data (with a preceding space), a value of 10 is converted to 10 GB.

Array Length

Return the length of the array specified in the Source field.

For example, consider the following schema from the source:

JSON
{
   "level1": {
      "level2": [
         {
            "value1": "something"
         },
         {
            "value2": "something"
         }
      }
   }
}

If you select to return the array length of the level1.level2 array, the data is converted to 2.

Note: If the field that you specify is not an array, the data converts to null.
Lowercase

Convert all characters in the data to lowercase.

For example, if you select the Lowercase convert operation, a value of ABC123def789GHI is converted to abc123def789ghi.

Replace

Match a string or regular expression in the data with a replacement value.

For example, if you enter a Match value of ([^\\s]+).* (anything other than a space character at the start of a string) and select a Replace value of $1, a value of My Company is converted to My.

Tip: The replace operation accepts the same regular expressions as the JavaScript replace function. For more information about acceptable patterns, see Specifying a string as the replacement.
Prefix

Enter a value to prepend to the data.

For example, if you select to prepend SN_ to the data, a value of 123456789 is converted to SN_123456789.

Dot-notation syntax

Paths use standard JavaScript dot-notation syntax to navigate through a JSON object. Consider the following JSON example:

JSON
{
   "level1": {
      "level2": {
         "value": "something",
      }
   }
}

To map the data in "value" the path would be level1.level2.value and the returned value is "something".

The path also supports arrays, where bracket parentheses index within the array.

JSON
{
   "level1": [
      {
         "value": "something1",
      },
      {
         "value": "something2".
      }
   ]
}

Use the zero-based index within the array for mapping. For example, level1[0].value maps to "something1".

Arrays also support negative indexes to index from the bottom of the array. For example, level1[-1].value maps to "something2".

Test field mappings

To view field mappings for a source, you can manually import the source from the Schedules page or wait until the next scheduled import.

To manually import the source, perform the following:

  1. From the Main menu, go to Modules > Asset > Inventory Management > Schedules.

  2. In the row of the source that you want to import on the Import Schedules tab, click Run Now caret-right.