The following example concatenates "str" and "ing" together, returning "string": The is optional, and if not specified returns the rest of the string. Negative indexes can be used to indicate a start from the end of the string. The indexes follow SQLite semantics they start at 1. The length of the substring specifies the number of character to return. This function returns a substring of a string, beginning at the start index. Index=twitter | eval output=spath(_raw, "entities.hashtags") substr(,) Description The following example returns the hashtags from a twitter event. The following example returns the values of locDesc elements. 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(,) Description 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 ,) Description This function substitutes the replacement string for every occurrence of the regular expression in the string. | eval cost=ltrim(NET_COST, "$") replace(,) Description The following example removes the dollar sign ( $ ) from the results for the NET_COST field. The value that is returned is x="abcZZ ". 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. The argument can be the name of a string field or a string literal. This function removes characters from the left side of a string. | eval username=lower(username) ltrim(,) Description The following example returns the value provided by the field username in lowercase. You can use this function on multivalue fields. This function takes one string argument and returns the string in lowercase. The results show a count of the character length of the values in the names field: You can determine the length of the values in the names field using the len function: Suppose you have a set of results that looks something like this: This function is not supported on multivalue fields. You can use this function with the eval, fieldformat, and where commands, and as part of eval expressions. 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 Evaluation functions.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |