Skip to content

Commit 86e2506

Browse files
Merge pull request #2647 from MicrosoftDocs/main638849774686677722sync_temp
For protected branch, push strategy should use PR and merge to target branch method to work around git push error
2 parents d1eb2cc + f12c6fe commit 86e2506

File tree

2 files changed

+26
-20
lines changed

2 files changed

+26
-20
lines changed

data-explorer/kusto/query/extract-function.md

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,27 @@ If there's no match, or the type conversion fails: `null`.
3636

3737
## Examples
3838

39-
The following example extracts the month from the string `Dates` and returns a table with the date string and the month.
39+
The following example extract the username, email, age from the string. The regular expressions are used to extract the information.
40+
41+
:::moniker range="azure-data-explorer"
42+
> [!div class="nextstepaction"]
43+
> <a href="https://dataexplorer.azure.com/clusters/help/databases/Samples?query=H4sIAAAAAAAAA8tJLVEISa0oUbBVUAotTi2yUvDKz8hzyU%2FVUXDNTczMsVLIAvJT8lMdUisScwtyUvWS83N1FBzTU60UjCyVrLkKijLzShRAWv0Sc1OBxgANK0pMLtGAGqcRHacTq62ppKNgqAO2SVOHC2yyZwqSYgclqG0aMcHamjooqoF2oaiMSdEGyhtA5QFR4bA2wQAAAA%3D%3D" target="_blank">Run the query</a>
44+
::: moniker-end
45+
46+
```kusto
47+
let Text = "User: JohnDoe, Email: [email protected], Age: 29";
48+
print UserName = extract("User: ([^,]+)", 1, Text),
49+
EmailId = extract(@"Email: (\S+),", 1, Text),
50+
Age = extract(@"\d+", 0, Text)
51+
```
52+
53+
**Output**
54+
55+
| UserName | EmailId | Age |
56+
| --- | --- | --- |
57+
| JohnDoe | [email protected] | 29 |
58+
59+
The following example extracts the month from the string `Dates` and returns a table with the date string and the month as int type.
4060

4161
:::moniker range="azure-data-explorer"
4262
> [!div class="nextstepaction"]
@@ -63,24 +83,6 @@ Dates
6383
| 21-07-2023 | 7 |
6484
| 10-03-2022 | 3 |
6585

66-
The following example returns the username from the string. The regular expression `([^,]+)` matches the text following "User: " up to the next comma, effectively extracting the username.
67-
68-
:::moniker range="azure-data-explorer"
69-
> [!div class="nextstepaction"]
70-
> <a href="https://dataexplorer.azure.com/clusters/help/databases/Samples?query=H4sIAAAAAAAAA8tJLVEISa0oUbBVUAotTi2yUvDKz8hzyU%2FVUXDNTczMsVLIAvJT8lMdUisScwtyUvWS83N1FBzTU60UjCyVrLkKijLzShRAWv0Sc1OBxgANK0pMLtGAGqcRHacTq62ppKNgqAO2SRMAAQTyB3MAAAA%3D" target="_blank">Run the query</a>
71-
::: moniker-end
72-
73-
```kusto
74-
let Text = "User: JohnDoe, Email: [email protected], Age: 29";
75-
print UserName = extract("User: ([^,]+)", 1, Text)
76-
```
77-
78-
**Output**
79-
80-
| UserName |
81-
| --- |
82-
| JohnDoe |
83-
8486
## Related content
8587

8688
* [extract-all function](extract-all-function.md)

data-explorer/kusto/query/time-series-analysis.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,11 @@ demo_series3
146146

147147
:::image type="content" source="media/time-series-analysis/time-series-seasonality.png" alt-text="Time series seasonality.":::
148148

149-
- Use [series_periods_detect()](series-periods-detect-function.md) to automatically detect the periods in the time series.
149+
- Use [series_periods_detect()](series-periods-detect-function.md) to automatically detect the periods in the time series, where:
150+
- `num`: the time series to analyze
151+
- `0.`: the minimum period length in days (0 means no minimum)
152+
- `14d/2h`: the maximum period length in days, which is 14 days divided into 2-hour bins
153+
- `2`: the number of periods to detect
150154
- Use [series_periods_validate()](series-periods-validate-function.md) if we know that a metric should have specific distinct period(s) and we want to verify that they exist.
151155

152156
> [!NOTE]

0 commit comments

Comments
 (0)