

This function returns a substring of a string, beginning at the start index. Index=twitter | eval output=spath(_raw, "entities.hashtags") substr(,) The following example returns the hashtags from a twitter event. The following example returns the values of locDesc elements from the _raw field. Using a field name for might result in a multivalue field. If is a field name, with values that are the location paths, the field name doesn't need quotation marks.If is a literal string, you need to enclose the string in double quotation marks.The is an spath expression for the location path to the value that you want to extract from. Use this function to extract information from the structured data formats XML and JSON. | eval n=rtrim(" ZZZZabcZZ ", " Z") spath(,) The following example trims the leading spaces and all of the occurrences of the letter Z from the right side of the string. If not specified, spaces and tabs are removed from the right side of the string. This function removes the trim characters from the right side of the string. The argument can also reference groups that are matched in the ,) This function substitutes the replacement string for every occurrence of the regular expression in the string. | eval x=ltrim(" ZZZZabcZZ ", " Z") replace(,)

The following example trims the leading spaces and all of the occurrences of the letter Z from the left side of the string. If not specified, spaces and tabs are removed from the left side of the string. This function removes characters from the left side of a string. The following example returns the values in the username field in lowercase. This function returns a string in lowercase. This example returns the character length of the values in the categoryId field for each result. You can use this function with the eval and where commands, in the WHERE clause of the from command, and as part of evaluation expressions with other commands. The argument can be the name of a string field or a string literal. This function returns the character length of a string. The following list contains the functions that you can use with string values.įor information about using string and numeric fields in functions, and nesting functions, see Overview of SPL2 eval functions.
