![]() |
Consumption Analytics Documentation |
InputIdentifier
is used in the configuration for the CreateIdentifierFromIdentifier and ModifyResourceNameFromIdentifier transforms. It describes a token to be used for the assembly of a new identifier. You can specify start and end positions to take a portion of an identifier value rather than the entire value. You can also set a prefix and/or suffix to include static text as part of the resulting token.
The following examples show how InputIdentifier
can be used with transform processors.
Host
identifier, prepends with 'H
' and appends with '-
'. If the original value is less than three characters, then right pad with spaces before applying prefix or suffix. <bean class="com.cloudcruiser.batch.transform.InputIdentifier"> <property name="name" value="Host"/> <property name="start" value="0"/> <property name="len" value="3"/> <property name="padding" value="TRAILING"/> <property name="paddingChar" value=" "/> <property name="prefix" value="H"/> <property name="suffix" value="‐"/> </bean>
NetworkName
identifier value starting at the 5th character, and ignores first 4 characters: <bean class="com.cloudcruiser.batch.transform.InputIdentifier"> <property name="name" value="NetworkName"/> <property name="start" value="5"/> </bean>
NetworkName
identifier value starting at the 5th character (ignores first 4 characters) and ending at 10th character (exclusive) for a maximum length of 6 characters. If the input is only 7 characters, then the resulting value will be 3 characters in length. <bean class="com.cloudcruiser.batch.transform.InputIdentifier"> <property name="name" value="NetworkName"/> <property name="start" value="5"/> <property name="end" value="10"/> </bean>
DiskName
identifier value up to '-
' character. <bean class="com.cloudcruiser.batch.transform.InputIdentifier"> <property name="name" value="DiskName"/> <property name="pattern" value="(.*)‐.*"/> </bean>
ServiceDescription
identifier’s first 100 characters. <bean class="com.cloudcruiser.batch.transform.InputIdentifier"> <property name="name" value="ServiceDescription"/> <property name="len" value="100"/> </bean>
NOTE: You can also truncate using the TruncateIdentifiers
transform. For more information, see Truncating identifier values.
<property name="padding" value="padding" />
Controls padding results for creating fixed length values. Options are LEADING, TRAILING and NONE. This setting only has an effect when an length or an end position is specified. If the source identifier value is less characters than the number of characters specified, then the value may be padded before it is concatenated to the new target identifier value being created. The default is TRAILING.
<property name="paddingChar" value="paddingChar" />
Sets the character to use when padding. This defaults to a space character.
<property name="start" value="start" />
Sets the starting offset to use when extracting text from an existing identifier value. The defaults is zero (0).
<property name="end" value="end" />
Sets the ending offset to use when extracting text from an existing identifier value. The range of characters extracted does not include the ending offset. A value of zero (0) has no effect and is the default value. An alternative to setting end would be to set len. If both are set to non-zero values, then end takes precedence.
<property name="len" value="length" />
Sets the maximum length for an extracted value. This is optional and has the same effect as setting end.
<property name="name" value="name" />
Sets the name of the identifier from which the value will be extracted.
<property name="pattern" value="pattern" />
Sets a regular expression pattern which is used to capture a portion of the identifier's value. The pattern is always applied to the entire identifier value. Once the match text is extracted, processing of the match is same as processing of original value when no pattern provided.
<property name="prefix" value="prefix" />
Sets the prefix to prepend to extracted identifier values when constructing output tokens.
<property name="suffix" value="suffix" />
Sets the prefix to prepend to extracted identifier values when constructing output tokens.
(c) Copyright 2017-2020 Hewlett Packard Enterprise Development LP