client/splunk.js
function(fieldName, label) {
            if (!this.dataModelObject.hasField(fieldName)) {
                throw new Error("Did not find field " + fieldName);
            }
            var f = this.dataModelObject.fieldByName(fieldName);
            if (!utils.contains(["number", "string"], f.type)) {
                throw new Error("Field was of type " + f.type + ", expected number or string.");
            }

            var row = {
                fieldName: fieldName,
                owner: f.owner,
                type: f.type,
                label: label
            };

            if ("number" === f.type) {
                row.display = "all";
            }

            this.rows.push(row);

            return this;
        }
function(fieldName, label) {
            if (!this.dataModelObject.hasField(fieldName)) {
                throw new Error("Did not find field " + fieldName);
            }
            var f = this.dataModelObject.fieldByName(fieldName);
            if (!utils.contains(["number", "string"], f.type)) {
                throw new Error("Field was of type " + f.type + ", expected number or string.");
            }

            var row = {
                fieldName: fieldName,
                owner: f.owner,
                type: f.type,
                label: label
            };

            if ("number" === f.type) {
                row.display = "all";
            }

            this.rows.push(row);

            return this;
        }
function ( fieldName , label ) { if ( ! this . dataModelObject . hasField ( fieldName ) ) { throw new Error ( "Did not find field " + fieldName ) ; } var f = this . dataModelObject . fieldByName ( fieldName ) ; if ( ! utils . contains ( [ "number" , "string" ] , f . type ) ) { throw new Error ( "Field was of type " + f . type + ", expected number or string." ) ; } var row = { fieldName : fieldName , owner : f . owner , type : f . type , label : label } ; if ( "number" === f . type ) { row . display = "all" ; } this . rows . push ( row ) ; return this ; }
Add a row split on a numeric or string valued field, splitting on each distinct value of the field.

@param {String} fieldName The name of field to split on.
@param {String} label A human readable name for this set of rows.
@return {splunkjs.Service.PivotSpecification} The updated pivot specification.

@method splunkjs.Service.PivotSpecification
Add a row split on a numeric or string valued field splitting on each distinct value of the field .