client/splunk.js
function(props) {
            props = props || {};
            props.owner = props.owner || "";

            this.id             = props.calculationID;
            this.type           = props.calculationType;
            this.comment        = props.comment || null;
            this.editable       = props.editable;
            this.lineage        = props.owner.split(".");
            this.owner          = this.lineage[this.lineage.length - 1];

            this.outputFields = [];
            for (var i = 0; i < props.outputFields.length; i++) {
                this.outputFields[props.outputFields[i].fieldName] = new root.DataModelField(props.outputFields[i]);
            }

            if ("Eval" === this.type || "Rex" === this.type) {
                this.expression = props.expression;
            }
            if ("GeoIP" === this.type || "Rex" === this.type) {
                this.inputField = props.inputField;
            }
            if ("Lookup" === this.type) {
                this.lookupName = props.lookupName;
                this.inputFieldMappings = props.lookupInputs[0];
            }
        }
function(props) {
            props = props || {};
            props.owner = props.owner || "";

            this.id             = props.calculationID;
            this.type           = props.calculationType;
            this.comment        = props.comment || null;
            this.editable       = props.editable;
            this.lineage        = props.owner.split(".");
            this.owner          = this.lineage[this.lineage.length - 1];

            this.outputFields = [];
            for (var i = 0; i < props.outputFields.length; i++) {
                this.outputFields[props.outputFields[i].fieldName] = new root.DataModelField(props.outputFields[i]);
            }

            if ("Eval" === this.type || "Rex" === this.type) {
                this.expression = props.expression;
            }
            if ("GeoIP" === this.type || "Rex" === this.type) {
                this.inputField = props.inputField;
            }
            if ("Lookup" === this.type) {
                this.lookupName = props.lookupName;
                this.inputFieldMappings = props.lookupInputs[0];
            }
        }
function ( props ) { props = props || { } ; props . owner = props . owner || "" ; this . id = props . calculationID ; this . type = props . calculationType ; this . comment = props . comment || null ; this . editable = props . editable ; this . lineage = props . owner . split ( "." ) ; this . owner = this . lineage [ this . lineage . length - 1 ] ; this . outputFields = [ ] ; for ( var i = 0 ; i < props . outputFields . length ; i ++ ) { this . outputFields [ props . outputFields [ i ] . fieldName ] = new root . DataModelField ( props . outputFields [ i ] ) ; } if ( "Eval" === this . type || "Rex" === this . type ) { this . expression = props . expression ; } if ( "GeoIP" === this . type || "Rex" === this . type ) { this . inputField = props . inputField ; } if ( "Lookup" === this . type ) { this . lookupName = props . lookupName ; this . inputFieldMappings = props . lookupInputs [ 0 ] ; } }
Constructor for a data model calculation.
SDK users are not expected to invoke this constructor directly.

@constructor
@param {Object} props A dictionary of properties to set:
- `calculationID` (_string_): The ID of this calculation.
- `calculationType` (_string_): The type of this calculation, see class docs for valid types.
- `editable` (_boolean_): Whether this calculation can be edited.
- `comment` (_string_): A comment for this calculation, or `null` if there isn't one.
- `owner` (_string_): The lineage of the data model object on which this calculation
is defined, items are delimited by a dot. This is converted into an array of
strings upon construction.
- `outputFields` (_array_): An array of the fields this calculation generates.
- `expression` (_string_): The expression to use for this calculation; exclusive to `Eval` and `Rex` calculations (optional)
- `inputField` (_string_): The field to use for calculation; exclusive to `GeoIP` and `Rex` calculations (optional)
- `lookupName` (_string_): The name of the lookup to perform; exclusive to `Lookup` calculations (optional)
- `inputFieldMappings` (_array_): One element array containing an object with the mappings from fields in the events to fields
in the lookup; exclusive to `Lookup` calculations (optional)

@method splunkjs.Service.DataModelCalculation
Constructor for a data model calculation . SDK users are not expected to invoke this constructor directly .