Console logs in Log Analytics workspace

%3CLINGO-SUB%20id%3D%22lingo-sub-2595278%22%20slang%3D%22en-US%22%3EConsole%20logs%20in%20Log%20Analytics%20workspace%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2595278%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3EI%20am%20using%20Console%20logs%20(ASP%20Core%20buildin%20ILogger)%20in%20App%20Service%20(Linux)%20and%20I%20found%20all%20logs%20in%20Log%20Analytics%20having%20Informational%20severity%20level.%20There%20is%20any%20way%20to%20make%20Level%20working%20correctly%3F%20May%20be%20special%20log%20format%3F%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Zaduvalo_1-1627578593818.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F299237i0871749F50F92051%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Zaduvalo_1-1627578593818.png%22%20alt%3D%22Zaduvalo_1-1627578593818.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E(custom%20log%20format%20on%20image)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2595278%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EApplication%20Insights%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ELog%20Analytics%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2611039%22%20slang%3D%22en-US%22%3ERe%3A%20Console%20logs%20in%20Log%20Analytics%20workspace%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2611039%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1115817%22%20target%3D%22_blank%22%3E%40Zaduvalo%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20you%20cant%20change%20the%20application%20that%20writes%20the%20logs%20into%20Log%20Analytics%20to%20have%20the%20values%20in%20Informational%20be%20correct.%20You%20can%20%3CSTRONG%3Eparse%3C%2FSTRONG%3E%20the%20correct%20values%20into%20a%20new%20column%20and%20use%20those.%26nbsp%3B%20%26nbsp%3BSort%20of%20like%20this....a%20fake%20basic%20example%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-cpp%22%3E%3CCODE%3Elet%20ResultDescription%20%3D%20%22jhjhjhjhjhjhj%20%7Cwarn%7C%20jdndm%22%3B%0AUsage%0A%7C%20parse%20ResultDescription%20with%20*%20'%7C'%20newLevel%20'%7C'%20*%0A%7C%20project%20newLevel%0A%7C%20where%20newLevel%20%3D%3D%20%22warn%22%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3Ecolumn%20correct.%20Then%20you%20could%20parse%20the%20other%20column%20and%20extract%20the%20values%20and%20use%20those%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

Hi,

I am using Console logs (ASP Core buildin ILogger) in App Service (Linux) and I found all logs in Log Analytics having Informational severity level. There is any way to make Level working correctly? May be special log format?

Zaduvalo_1-1627578593818.png

(custom log format on image)

 

Thanks

 

 

 

2 Replies

@Zaduvalo 

 

If you cant change the application that writes the logs into Log Analytics to have the values in Informational be correct. You can parse the correct values into a new column and use those.   Sort of like this....a fake basic example 

let ResultDescription = "jhjhjhjhjhjhj |warn| jdndm";
Usage
| parse ResultDescription with * '|' newLevel '|' *
| project newLevel
| where newLevel == "warn"

column correct. Then you could parse the other column and extract the values and use those

@CliveWatson Thanks, I found this is not a global problem, actual log level works fine if I am searching in Application Insights. But in Log Analytics workspace using "AppServiceConsoleLogs" query, Level always Informational.

This is not a parsing problem.