Dataloss in transfer between syslog and Azure LogAnalytics

%3CLINGO-SUB%20id%3D%22lingo-sub-1860791%22%20slang%3D%22en-US%22%3EDataloss%20in%20transfer%20between%20syslog%20and%20Azure%20LogAnalytics%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1860791%22%20slang%3D%22en-US%22%3E%3CP%3EWe're%20experiencing%20an%20issue%20where%20we%20lose%20data%20between%20our%20syslog%20server%20data%20and%20the%20results%20in%20Sentinels%20LogAnalytics.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOur%20configuration%20writes%20syslog%20messages%20to%20a%20file%20%2Fvar%2Fsyslog_data.%20This%20file%20is%20read%20by%20the%20rsyslog%20imfile%20module%20to%20forward%20its%20content%20to%20the%20OMS%20agents%20syslog%20port%20(25224)%2C%20to%20identify%20this%20data%20we%20gave%20it%20the%20syslog%20tag%20%22sys_data%22.%20We%20found%20this%20issue%20by%20comparing%20the%20counted%20lines%20in%20the%20%2Fvar%2Fsyslog_data%20file%20and%20the%20data%20received%20in%20the%20Sentinel%20workspace%20per%20day%20for%20the%20last%20week.%20The%20results%20show%20a%20mismatch%20of%20%C2%B180%25%20with%20peeks%20up%20to%2090%25%20of%20dataloss%2C%20see%20attached%20image%20for%20comparison%20results.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETo%20see%20if%20the%20configuration%20works%20properly%20we%20restarted%20the%20omsagent%20and%20added%20a%20new%20line%20tot%20the%20%2Fvar%2Fsyslog_data%20file%20with%20a%20copy%20of%20a%20line%20including%20some%20recognisable%20content.%20This%20was%20shown%20in%20Sentinel%20within%205%20minutes.%20Based%20on%20this%20test%20we%20conclude%20that%20the%20configuration%20is%20set%20properly.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ersyslog%20config%3A%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3Emodule(load%3D%22imfile%22)%0A%0Aruleset(name%3D%22syslog_data%22)%7B%0A%20action(type%3D%22omfwd%22%20Target%3D%22127.0.0.1%22%20Port%3D%2225224%22%20Protocol%3D%22udp%22)%0A%20stop%20%0A%7D%0A%0Ainput(type%3D%22imfile%22%20File%3D%22%2Fvar%2Flog%2Fsyslog_data.log%22%20Tag%3D%22sys_data%22%20Severity%3D%22warn%22%20Facility%3D%22local5%22%20PersistStateInterval%3D%221%22%20ruleset%3D%22syslog_data%22%20reopenOnTruncate%3D%22on%22)%26nbsp%3B%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eomsagent.d%2Fsyslog.conf%20config%3A%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3E%3CSOURCE%3E%0A%20%20type%20syslog%0A%20%20port%2025224%0A%20%20bind%20127.0.0.1%0A%20%20protocol_type%20udp%0A%20%20tag%20oms.syslog%0A%3C%2FSOURCE%3E%0A%0A%3CFILTER%20oms.syslog.%3D%22%22%3E%0A%20%20type%20filter_syslog%0A%3C%2FFILTER%3E%3C%2FCODE%3E%3C%2FPRE%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-1860791%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3Edataloss%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Eloganalytics%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Ersyslog%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESentinel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1860846%22%20slang%3D%22en-US%22%3ERe%3A%20Dataloss%20in%20transfer%20between%20syslog%20and%20Azure%20LogAnalytics%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1860846%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F860065%22%20target%3D%22_blank%22%3E%40reda21%3C%2FA%3E%26nbsp%3BThat's%20odd%2C%20but%20I%20wonder%20about%20your%20format.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhat%20process(es)%20are%20writing%20to%20%22%3CSPAN%3E%2Fvar%2Fsyslog_data%22%3F%20It%20may%20make%20more%20sense%20to%20configure%20the%20connector%20(OMS%20Agent)%20to%20read%20%2Fvar%2Fsyslog_data%20as%20a%20Custom%20Log%20versus%20send%20it%20in%20via%20syslog%3F%20If%20you%20do%20it%20that%20way%20you%20can%20see%20if%20the%20issue%20is%20with%20rsyslog%20forwarding%20the%20data%2C%20Sentinel%20assuming%20everything%20in%20%2Fvar%2Fsyslog_data%20is%20in%20syslog%20format%2C%20and%20if%20the%20problem%20is%20between%20your%20host%20and%20Azure.%20You%20can%20compare%20the%20size%20of%20the%20new%20data%20table%20(_CL%20table)%20to%20the%20number%20of%20lines%20in%20the%20%2Fvar%2Fsyslog_data%20file%20and%20see%20if%20any%20are%20lost%20between%20your%20site%20and%20Sentinel.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1861032%22%20slang%3D%22en-US%22%3ERe%3A%20Dataloss%20in%20transfer%20between%20syslog%20and%20Azure%20LogAnalytics%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1861032%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F744641%22%20target%3D%22_blank%22%3E%40JKatzmandu%3C%2FA%3E%26nbsp%3Bthanks%20for%20your%20reply%2C%20could%20you%20guid%20me%20to%20any%20information%20options%20or%20documentation%20which%20have%20info%20on%20how%20to%20configure%20the%20OMS%20agent%20to%20read%20the%20file%20directly%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

We're experiencing an issue where we lose data between our syslog server data and the results in Sentinels LogAnalytics.

 

Our configuration writes syslog messages to a file /var/syslog_data. This file is read by the rsyslog imfile module to forward its content to the OMS agents syslog port (25224), to identify this data we gave it the syslog tag "sys_data". We found this issue by comparing the counted lines in the /var/syslog_data file and the data received in the Sentinel workspace per day for the last week. The results show a mismatch of ±80% with peeks up to 90% of dataloss, see attached image for comparison results.

 

To see if the configuration works properly we restarted the omsagent and added a new line tot the /var/syslog_data file with a copy of a line including some recognisable content. This was shown in Sentinel within 5 minutes. Based on this test we conclude that the configuration is set properly.

 

rsyslog config:

module(load="imfile")

ruleset(name="syslog_data"){
 action(type="omfwd" Target="127.0.0.1" Port="25224" Protocol="udp")
 stop 
}

input(type="imfile" File="/var/log/syslog_data.log" Tag="sys_data" Severity="warn" Facility="local5" PersistStateInterval="1" ruleset="syslog_data" reopenOnTruncate="on") 

 

omsagent.d/syslog.conf config:

<source>
  type syslog
  port 25224
  bind 127.0.0.1
  protocol_type udp
  tag oms.syslog
</source>

<filter oms.syslog.**>
  type filter_syslog
</filter>

 

 

 

3 Replies

@reda21 That's odd, but I wonder about your format.

 

What process(es) are writing to "/var/syslog_data"? It may make more sense to configure the connector (OMS Agent) to read /var/syslog_data as a Custom Log versus send it in via syslog? If you do it that way you can see if the issue is with rsyslog forwarding the data, Sentinel assuming everything in /var/syslog_data is in syslog format, and if the problem is between your host and Azure. You can compare the size of the new data table (_CL table) to the number of lines in the /var/syslog_data file and see if any are lost between your site and Sentinel.

@JKatzmandu thanks for your reply, could you guid me to any information options or documentation which have info on how to configure the OMS agent to read the file directly?

@reda21 Once the agent is installed (which it is) you tell it to read a flat log file. It's basically like this:

 

https://docs.microsoft.com/en-us/azure/azure-monitor/platform/data-sources-custom-logs