Skip to content

Commit 5123baf

Browse files
Merge pull request #261648 from ivkhrul/ivankh-geolocation-function
Added documentation for geo_location() function.
2 parents 3a90e65 + d86eb73 commit 5123baf

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

articles/azure-monitor/essentials/data-collection-transformations-structure.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ ms.reviwer: nikeist
1010
---
1111

1212
# Structure of transformation in Azure Monitor
13-
[Transformations in Azure Monitor](./data-collection-transformations.md) allow you to filter or modify incoming data before it's stored in a Log Analytics workspace. They are implemented as a Kusto Query Language (KQL) statement in a [data collection rule (DCR)](data-collection-rule-overview.md). This article provides details on how this query is structured and limitations on the KQL language allowed.
13+
[Transformations in Azure Monitor](./data-collection-transformations.md) allow you to filter or modify incoming data before it's stored in a Log Analytics workspace. They're implemented as a Kusto Query Language (KQL) statement in a [data collection rule (DCR)](data-collection-rule-overview.md). This article provides details on how this query is structured and limitations on the KQL language allowed.
1414

1515

1616
## Transformation structure
17-
The KQL statement is applied individually to each entry in the data source. It must understand the format of the incoming data and create output in the structure of the target table. The input stream is represented by a virtual table named `source` with columns matching the input data stream definition. Following is a typical example of a transformation. This example includes the following functionality:
17+
The KQL statement is applied individually to each entry in the data source. It must understand the format of the incoming data and create output in the structure of the target table. A virtual table named `source` represents the input stream. `source` table columns match the input data stream definition. Following is a typical example of a transformation. This example includes the following functionality:
1818

1919
- Filters the incoming data with a [where](/azure/data-explorer/kusto/query/whereoperator) statement
2020
- Adds a new column using the [extend](/azure/data-explorer/kusto/query/extendoperator) operator
@@ -297,7 +297,7 @@ The following [Bitwise operators](/azure/data-explorer/kusto/query/binoperators)
297297

298298
##### parse_cef_dictionary
299299

300-
Given a string containing a CEF message, `parse_cef_dictionary` parses the Extension property of the message into a dynamic key/value object. Semicolon is a reserved character that should be replaced prior to passing the raw message into the method, as shown in the example below.
300+
Given a string containing a CEF message, `parse_cef_dictionary` parses the Extension property of the message into a dynamic key/value object. Semicolon is a reserved character that should be replaced prior to passing the raw message into the method, as shown in the example.
301301

302302
```kusto
303303
| extend cefMessage=iff(cefMessage contains_cs ";", replace(";", " ", cefMessage), cefMessage)
@@ -308,6 +308,24 @@ Given a string containing a CEF message, `parse_cef_dictionary` parses the Exten
308308

309309
:::image type="content" source="media/data-collection-transformations-structure/parse_cef_dictionary.png" alt-text="Sample output of parse_cef_dictionary function." lightbox="media/data-collection-transformations-structure/parse_cef_dictionary.png":::
310310

311+
##### geo_location
312+
313+
Given a string containing IP address (IPv4 and IPv6 are supported), `geo_location` function returns approximate geographical location, including the following attributes:
314+
* Country
315+
* Region
316+
* State
317+
* City
318+
* Latitude
319+
* Longitude
320+
321+
```kusto
322+
| extend GeoLocation = geo_location("1.0.0.5")
323+
```
324+
325+
:::image type="content" source="media/data-collection-transformations-structure/geo-location.png" alt-text="Screenshot of sample output of geo_location function." lightbox="media/data-collection-transformations-structure/parse_cef_dictionary.png":::
326+
327+
> [!IMPORTANT]
328+
> Due to nature of IP geolocation service utilized by this function, it may introduce data ingestion latency if used excessively. Exercise caution when using this function more than several times per transformation.
311329
312330
### Identifier quoting
313331
Use [Identifier quoting](/azure/data-explorer/kusto/query/schema-entities/entity-names?q=identifier#identifier-quoting) as required.
47.2 KB
Loading

0 commit comments

Comments
 (0)