Custom Logs on AKS & Azure Monitor

Copper Contributor

I have containers deployed in AKS. Those containers log into custom files. I want to analyse those logs using Azure Monitor (Log Analytics).

 

Kindly provide the steps to achieve that.

 

Thank You

2 Replies

@Ajay_Kumar_Sharma 

You can write app logs to STDOUT and then oms agent will push these logs to log analytics workspace.

 

You can refer to logs under container logs ... using Log Query 

ContainerLog
| project TimeGenerated  ,LogEntry, LogEntrySource
 

more on    https://youtube.com/watch?v=RjsNmapggPU

@Ajay_Kumar_Sharma 

 

Hi what is format of your log files ? 

If you don't use  OMS agent you can use externaldata operator to read files, like csv or tsv, scsv, sohsv, psv, txt, raw.

https://docs.microsoft.com/en-us/azure/data-explorer/kusto/query/externaldata-operator?pivots=azured...

You can also parse text or use predefined  structures like 

JSON

XML

IPv4

URL

URL query

File path

User agent

Version string

https://docs.microsoft.com/fr-fr/azure/azure-monitor/log-query/parse-text