.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 designator
of the ISO 8601 durations. This duration is then substracted from the currentUTC
time. For example:5M
: get all the logs for the last5
minutes1H
: get all the logs for the last1
hour- You can combine them too if you feel like it, i.e.
2H3M5S
would get all the logs for the last7385
seconds
<from>
:ISO 8601 date time
expressed 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 time
expressed 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:
Read
andList
permissionsTables
serviceContainer
andObject
resource 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 designator
of the ISO 8601 durations. This duration is then substracted from the currentUTC
time. For example:5M
: get all the logs for the last5
minutes1H
: get all the logs for the last1
hour- You can combine them too if you feel like it, i.e.
2H3M5S
would get all the logs for the last7385
seconds
<from>
:ISO 8601 date time
expressed 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 time
expressed 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:
Read
andList
permissionsBlobs
serviceContainer
andObject
resource types- A short expiration time
Generated,Level,Message
2018-06-18T09:50:28.155T,Information,"Some logging event I wrote"
Generated
is expressed inUTC
- The
Level
is written as-is for blobs and converted from theLevel
column for theWADLogsTable
:1
:Fatal
2
:Error
3
:Warning
4
:Information
5
:Verbose
- Everything else:
Undefined
Note: this format is compatible with the Splunk
csv
source type.