.NET Core global tools to retrieve Azure Diagnostics logs from a WADLogsTable or blobs and write them to a CSV file.
| Package | Release |
|---|---|
dotnet-wad-to-csv |
|
dotnet-blob-to-csv |
| CI | Status | Platform(s) | Framework(s) |
|---|---|---|---|
| AppVeyor | Windows |
netcoreapp3.1 |
> dotnet tool install -g dotnet-wad-to-csv> dotnet tool install -g dotnet-blob-to-csv> dotnet wad-to-csv -l <last> -o <output-file-path>> dotnet wad-to-csv -f <from> -o <output-file-path>> dotnet wad-to-csv -f <from> -t <to> -o <output-file-path><last>: based on thetime designatorof the ISO 8601 durations. This duration is then substracted from the currentUTCtime. For example:5M: get all the logs for the last5minutes1H: get all the logs for the last1hour- You can combine them too if you feel like it, i.e.
2H3M5Swould get all the logs for the last7385seconds
<from>:ISO 8601 date timeexpressed inUTC. Cannot be combined with<last>, can be combined with<to>.- Valid date time:
2018-06-24T23:12:15 - The time component can be omitted:
2018-06-24
- Valid date time:
<to>:ISO 8601 date timeexpressed inUTC. Must be be combined with<from>.<output-file-path>: where you wish to write the output file, does not need to exist but should be valid. If a file exists with the same name it will be replaced.
The tool will prompt you for a Shared Access Signature so that it doesn't get saved to your CLI history. I recommend you restrict the SAS to:
ReadandListpermissionsTablesserviceContainerandObjectresource types- A short expiration time
WAD to CSV will attempt to obfuscate settings that have been logged due to this issue in the Microsoft.WindowsAzure.ConfigurationManager.
> dotnet blob-to-csv -l <last> -o <output-file-path> -c <container> -p <prefix>> dotnet blob-to-csv -f <from> -o <output-file-path> -c <container> -p <prefix>> dotnet blob-to-csv -f <from> -t <to> -o <output-file-path> -c <container> -p <prefix><last>: based on thetime designatorof the ISO 8601 durations. This duration is then substracted from the currentUTCtime. For example:5M: get all the logs for the last5minutes1H: get all the logs for the last1hour- You can combine them too if you feel like it, i.e.
2H3M5Swould get all the logs for the last7385seconds
<from>:ISO 8601 date timeexpressed inUTC. Cannot be combined with<last>, can be combined with<to>.- Valid date time:
2018-06-24T23:12:15 - The time component can be omitted:
2018-06-24
- Valid date time:
<to>:ISO 8601 date timeexpressed inUTC. Must be be combined with<from>.<output-file-path>: where you wish to write the output file, does not need to exist but should be valid. If a file exists with the same name it will be replaced.<container>: The name of the container. Forhttps://account.blob.core.windows.net/container-name/prefix/2018/06/22/00/e872fe-54660.applicationLog.csv, the container name iscontainer-name.<prefix>: The prefix (if any). Forhttps://account.blob.core.windows.net/container-name/prefix/2018/06/22/00/e872fe-54660.applicationLog.csv, the prefix isprefix.
The tool will prompt you for a Shared Access Signature so that it doesn't get saved to your CLI history. I recommend you restrict the SAS to:
ReadandListpermissionsBlobsserviceContainerandObjectresource types- A short expiration time
Generated,Level,Message
2018-06-18T09:50:28.155T,Information,"Some logging event I wrote"
Generatedis expressed inUTC- The
Levelis written as-is for blobs and converted from theLevelcolumn for theWADLogsTable:1:Fatal2:Error3:Warning4:Information5:Verbose- Everything else:
Undefined
Note: this format is compatible with the Splunk csv source type.