diff --git a/data-explorer/kusto/query/extract-function.md b/data-explorer/kusto/query/extract-function.md index c922c2c328..36789aa99f 100644 --- a/data-explorer/kusto/query/extract-function.md +++ b/data-explorer/kusto/query/extract-function.md @@ -36,7 +36,27 @@ If there's no match, or the type conversion fails: `null`. ## Examples -The following example extracts the month from the string `Dates` and returns a table with the date string and the month. +The following example extract the username, email, age from the string. The regular expressions are used to extract the information. + +:::moniker range="azure-data-explorer" +> [!div class="nextstepaction"] +> Run the query +::: moniker-end + +```kusto +let Text = "User: JohnDoe, Email: johndoe@example.com, Age: 29"; +print UserName = extract("User: ([^,]+)", 1, Text), +EmailId = extract(@"Email: (\S+),", 1, Text), +Age = extract(@"\d+", 0, Text) +``` + +**Output** + +| UserName | EmailId | Age | +| --- | --- | --- | +| JohnDoe | johndoe@example.com | 29 | + +The following example extracts the month from the string `Dates` and returns a table with the date string and the month as int type. :::moniker range="azure-data-explorer" > [!div class="nextstepaction"] @@ -63,24 +83,6 @@ Dates | 21-07-2023 | 7 | | 10-03-2022 | 3 | -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. - -:::moniker range="azure-data-explorer" -> [!div class="nextstepaction"] -> Run the query -::: moniker-end - -```kusto -let Text = "User: JohnDoe, Email: johndoe@example.com, Age: 29"; -print UserName = extract("User: ([^,]+)", 1, Text) -``` - -**Output** - -| UserName | -| --- | -| JohnDoe | - ## Related content * [extract-all function](extract-all-function.md) diff --git a/data-explorer/kusto/query/time-series-analysis.md b/data-explorer/kusto/query/time-series-analysis.md index 8051665c9b..5765cc0a5c 100644 --- a/data-explorer/kusto/query/time-series-analysis.md +++ b/data-explorer/kusto/query/time-series-analysis.md @@ -146,7 +146,11 @@ demo_series3 :::image type="content" source="media/time-series-analysis/time-series-seasonality.png" alt-text="Time series seasonality."::: -- Use [series_periods_detect()](series-periods-detect-function.md) to automatically detect the periods in the time series. +- Use [series_periods_detect()](series-periods-detect-function.md) to automatically detect the periods in the time series, where: + - `num`: the time series to analyze + - `0.`: the minimum period length in days (0 means no minimum) + - `14d/2h`: the maximum period length in days, which is 14 days divided into 2-hour bins + - `2`: the number of periods to detect - 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. > [!NOTE]