-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Add time interval dim filter and retention analysis example #3315
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -150,6 +150,33 @@ Search filters can be used to filter on partial string matches. | |
|
|
||
| The search filter supports the use of extraction functions, see [Filtering with Extraction Functions](#filtering-with-extraction-functions) for details. | ||
|
|
||
| #### Search Query Spec | ||
|
|
||
| ##### Contains | ||
|
|
||
| |property|description|required?| | ||
| |--------|-----------|---------| | ||
| |type|This String should always be "contains".|yes| | ||
| |value|A String value to run the search over.|yes| | ||
| |caseSensitive|Whether two string should be compared as case sensitive or not|no (default == false)| | ||
|
|
||
| ##### Insensitive Contains | ||
|
|
||
| |property|description|required?| | ||
| |--------|-----------|---------| | ||
| |type|This String should always be "insensitive_contains".|yes| | ||
| |value|A String value to run the search over.|yes| | ||
|
|
||
| Note that an "insensitive_contains" search is equivalent to a "contains" search with "caseSensitive": false (or not | ||
| provided). | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be marked as 'deprecated' now right? Also maybe the example above should be updated.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @vogievetsky was insensitive contains deprecated? I just moved this SearchQuerySpec section around since it was separated from the SearchFilter documentation by the InFilter stuff |
||
|
|
||
| ##### Fragment | ||
|
|
||
| |property|description|required?| | ||
| |--------|-----------|---------| | ||
| |type|This String should always be "fragment".|yes| | ||
| |values|A JSON array of String values to run the search over.|yes| | ||
| |caseSensitive|Whether strings should be compared as case sensitive or not. Default: false(insensitive)|no| | ||
|
|
||
| ### In filter | ||
|
|
||
|
|
@@ -245,33 +272,62 @@ Likewise, this filter expresses `age >= 18` | |
| ``` | ||
|
|
||
|
|
||
| #### Search Query Spec | ||
| ### Interval Filter | ||
|
|
||
| ##### Contains | ||
| The Interval filter enables range filtering on columns that contain long millisecond values, with the boundaries specified as ISO 8601 time intervals. It is suitable for the `__time` column, long metric columns, and dimensions with values that can be parsed as long milliseconds. | ||
|
|
||
| |property|description|required?| | ||
| |--------|-----------|---------| | ||
| |type|This String should always be "contains".|yes| | ||
| |value|A String value to run the search over.|yes| | ||
| |caseSensitive|Whether two string should be compared as case sensitive or not|no (default == false)| | ||
| This filter converts the ISO 8601 intervals to long millisecond start/end ranges and translates to an OR of Bound filters on those millisecond ranges, with numeric comparison. The Bound filters will have left-closed and right-open matching (i.e., start <= time < end). | ||
|
|
||
| ##### Insensitive Contains | ||
| |property|type|description|required?| | ||
| |--------|-----------|---------|---------| | ||
| |type|String|This should always be "interval".|yes| | ||
| |dimension|String|The dimension to filter on|yes| | ||
| |intervals|Array|A JSON array containing ISO-8601 interval strings. This defines the time ranges to filter on.|yes| | ||
| |extractionFn|[Extraction function](#filtering-with-extraction-functions)| Extraction function to apply to the dimension|no| | ||
|
|
||
| The interval filter supports the use of extraction functions, see [Filtering with Extraction Functions](#filtering-with-extraction-functions) for details. | ||
|
|
||
| |property|description|required?| | ||
| |--------|-----------|---------| | ||
| |type|This String should always be "insensitive_contains".|yes| | ||
| |value|A String value to run the search over.|yes| | ||
| If an extraction function is used with this filter, the extraction function should output values that are parseable as long milliseconds. | ||
|
|
||
| Note that an "insensitive_contains" search is equivalent to a "contains" search with "caseSensitive": false (or not | ||
| provided). | ||
| The following example filters on the time ranges of October 1-7, 2014 and November 15-16, 2014. | ||
| ```json | ||
| { | ||
| "type" : "interval", | ||
| "dimension" : "__time", | ||
| "intervals" : [ | ||
| "2014-10-01T00:00:00.000Z/2014-10-07T00:00:00.000Z", | ||
| "2014-11-15T00:00:00.000Z/2014-11-16T00:00:00.000Z" | ||
| ] | ||
| } | ||
| ``` | ||
|
|
||
| ##### Fragment | ||
| The filter above is equivalent to the following OR of Bound filters: | ||
|
|
||
| |property|description|required?| | ||
| |--------|-----------|---------| | ||
| |type|This String should always be "fragment".|yes| | ||
| |values|A JSON array of String values to run the search over.|yes| | ||
| |caseSensitive|Whether strings should be compared as case sensitive or not. Default: false(insensitive)|no| | ||
| ```json | ||
| { | ||
| "type": "or", | ||
| "fields": [ | ||
| { | ||
| "type": "bound", | ||
| "dimension": "__time", | ||
| "lower": "1412121600000", | ||
| "lowerStrict": false, | ||
| "upper": "1412640000000" , | ||
| "upperStrict": true, | ||
| "ordering": "numeric" | ||
| }, | ||
| { | ||
| "type": "bound", | ||
| "dimension": "__time", | ||
| "lower": "1416009600000", | ||
| "lowerStrict": false, | ||
| "upper": "1416096000000" , | ||
| "upperStrict": true, | ||
| "ordering": "numeric" | ||
| } | ||
| ] | ||
| } | ||
| ``` | ||
|
|
||
| ### Filtering with Extraction Functions | ||
| Some filters optionally support the use of extraction functions. | ||
|
|
@@ -343,3 +399,15 @@ Filtering on day of week: | |
| } | ||
| } | ||
| ``` | ||
|
|
||
| Filtering on a set of ISO 8601 intervals: | ||
| ```json | ||
| { | ||
| "type" : "interval", | ||
| "dimension" : "__time", | ||
| "intervals" : [ | ||
| "2014-10-01T00:00:00.000Z/2014-10-07T00:00:00.000Z", | ||
| "2014-11-15T00:00:00.000Z/2014-11-16T00:00:00.000Z" | ||
| ] | ||
| } | ||
| ``` | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| 2014102001 product_1 pty_country_1 | ||
| 2014102001 product_1 pty_country_2 | ||
| 2014102001 product_1 pty_country_3 | ||
| 2014102001 product_1 pty_country_4 | ||
| 2014102001 product_1 pty_country_5 | ||
| 2014102001 product_1 pty_country_6 | ||
| 2014102001 product_1 pty_country_7 | ||
| 2014102001 product_1 pty_country_8 | ||
| 2014102001 product_1 pty_country_9 | ||
| 2014102001 product_1 pty_country_10 | ||
| 2014102001 product_1 pty_country_11 | ||
| 2014102001 product_1 pty_country_12 | ||
| 2014102001 product_1 pty_country_13 | ||
| 2014102001 product_1 pty_country_14 | ||
| 2014102001 product_1 pty_country_15 | ||
| 2014102001 product_1 pty_country_16 | ||
| 2014102001 product_1 pty_country_17 | ||
| 2014102001 product_1 pty_country_18 | ||
| 2014102001 product_1 pty_country_19 | ||
| 2014102001 product_1 pty_country_20 | ||
| 2014102101 product_1 pty_country_1 | ||
| 2014102101 product_1 pty_country_2 | ||
| 2014102101 product_1 pty_country_3 | ||
| 2014102101 product_1 pty_country_4 | ||
| 2014102101 product_1 pty_country_5 | ||
| 2014102101 product_1 pty_country_6 | ||
| 2014102101 product_1 pty_country_7 | ||
| 2014102101 product_1 pty_country_8 | ||
| 2014102101 product_1 pty_country_9 | ||
| 2014102101 product_1 pty_country_10 | ||
| 2014102101 product_1 pty_country_50 | ||
| 2014102101 product_1 pty_country_51 | ||
| 2014102101 product_1 pty_country_52 | ||
| 2014102101 product_1 pty_country_53 | ||
| 2014102101 product_1 pty_country_54 | ||
| 2014102101 product_1 pty_country_55 | ||
| 2014102101 product_1 pty_country_56 | ||
| 2014102101 product_1 pty_country_57 | ||
| 2014102101 product_1 pty_country_58 | ||
| 2014102101 product_1 pty_country_59 | ||
| 2014102201 product_1 pty_country_1 | ||
| 2014102201 product_1 pty_country_2 | ||
| 2014102201 product_1 pty_country_3 | ||
| 2014102201 product_1 pty_country_4 | ||
| 2014102201 product_1 pty_country_5 | ||
| 2014102201 product_1 pty_country_60 | ||
| 2014102201 product_1 pty_country_61 | ||
| 2014102201 product_1 pty_country_62 | ||
| 2014102201 product_1 pty_country_63 | ||
| 2014102201 product_1 pty_country_64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some extraneous whitespace here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gianm removed whitespace