Skip to content

Instantly share code, notes, and snippets.

@h3xagn
Last active May 14, 2022 14:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save h3xagn/d3ef4fe0c0e3fe09c2110fd73872930d to your computer and use it in GitHub Desktop.
Save h3xagn/d3ef4fe0c0e3fe09c2110fd73872930d to your computer and use it in GitHub Desktop.
Build ETL from device to cloud: https://h3xagn.com
//continuous export of data
.create-or-alter continuous-export ParquetExport over (raw_oil_data) to table factOilData
with
(intervalBetweenRuns=1h, sizeLimit=104857600)
<| raw_oil_data
//adding summarize query before parse to handle potential duplicate data
| summarize arg_max(TimeStamp, *) by TimeStamp, TagName
| project-away TimeStamp1
//adding range check - between is inclusive at both limits
| where Value between (0 .. 10000)
//adding check to ensure TagName is not empty
| where isnotempty(TagName)
| parse TagName with Site: string '.' System: string '.' EqmtIp: string '.' Tag: string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment