Wonder if some one could assist with problem I have
Background:
We have logstash 5.4.1 installed on a three node cluster and 80 clients, servers and workstations. All workstations are configured for winlogbeat to pick up the application logs.
It's very locked down desktop. I have had to create an icon on the users desktop for when a bespoke application appears to hang.
The user uses this icon which points to a batch script (Poweshell disabled, I know old technology) which terminates the application and writes a custom entry into the Windows Application Eventlog.
I have set the entry as a level 2 (Error) one, Custom entries must have EventID's of between 900 and 1000... I have chose 910 as that one is free from looking at the other events.
Now the problem:
The script writes to the Evenlog I can see it... I can close the application a number of times via the script and see the entries in the Application Eventlog. However the entry DOES NOT get picked up by winlogbeat. All other entries in the eventlog are picked up.
I have looked in the winlogbeat.log and searched for the entry in the logs folder.. it's not in there.
I have looked at the logstash input, filter and output to see if there's anything being dropped but nothing there.. The fact that it's not even getting to the local log file is concerning me so I am focusing there .
What OS version? How are you writing the event to log? Can you share the Winlogbeat config that you are using?
I recommend running a simple test with the following config. It will read only event ID 910 from Application and write it to a local file instead of LS and enable debug logging.
Stop the Winlogbeat service.
Write this config file to disk as given below.
Run Winlogbeat from the CLI with .\winlogbeat.exe -c winlogbeat-test.yml.
After letting it run for a bit you can stop it.
Check the .\test\winlogbeat-event.json file and the .\test\winlogbeat.log.
I ran it as requested and I can see the event_id in both the JSON and winlogbeat.log file... see attached...
So if winlogbeat picks it up in debug mode why doesn't it pick it up in 'normal' or 'standard' mode? Let me know if you need anymore info or the files complete.
First part of winlogbeat.JSON
{"@timestamp":"2018-02-02T00:58:29.000Z","beat":{"hostname":"F1-D0N343695","name":"F1-D0N343695","version":"5.2.2"},"computer_name":"F1-D0N343695.national.core.bbc.co.uk","event_data":{"param1":"Weather Presenter Process was Terminated"},"event_id":910,"keywords":["Classic"],"level":"Error","log_name":"Application","message":"Weather Presenter Process was Terminated","opcode":"Info","record_number":"7331656","source_name":"Daviz3DDirector.exe","type":"wineventlog","user":{"domain":"NATIONAL","identifier":"S-1-5-21-73586283-854245398-682003330-932526","name":"tec-tp-pc","type":"User"},"xml":"\u003cEvent xmlns='http://schemas.microsoft.com/win/2004/08/events/event'\u003e\u003cSystem\u003e\u003cProvider Name='Daviz3DDirector.exe'/\u003e\u003cEventID Qualifiers='0'\u003e910\u003c/EventID\u003e\u003cLevel\u003e2\u003c/Level\u003e\u003cTask\u003e0\u003c/Task\u003e\u003cKeywords\u003e0x80000000000000\u003c/Keywords\u003e\u003cTimeCreated SystemTime='2018-02-02T00:58:29.000000000Z'/\u003e\u003cEventRecordID\u003e7331656\u003c/EventRecordID\u003e\u003cChannel\u003eApplication\u003c/Channel\u003e\u003cComputer\u003eF1-D0N343695.national.core.bbc.co.uk\u003c/Computer\u003e\u003cSecurity UserID='S-1-5-21-73586283-854245398-682003330-932526'/\u003e\u003c/System\u003e\u003cEventData\u003e\u003cData\u003eWeather Presenter Process was Terminated\u003c/Data\u003e\u003c/EventData\u003e\u003cRenderingInfo Culture='en-GB'\u003e\u003cMessage\u003eWeather Presenter Process was Terminated\u003c/Message\u003e\u003cLevel\u003eError\u003c/Level\u003e\u003cTask\u003e\u003c/Task\u003e\u003cOpcode\u003eInfo\u003c/Opcode\u003e\u003cChannel\u003e\u003c/Channel\u003e\u003cProvider\u003e\u003c/Provider\u003e\u003cKeywords\u003e\u003cKeyword\u003eClassic\u003c/Keyword\u003e\u003c/Keywords\u003e\u003c/RenderingInfo\u003e\u003c/Event\u003e\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\
First part winlogbeat.log
2018-02-02T07:39:50Z INFO Metrics logging every 30s
2018-02-02T07:39:50Z INFO Setup Beat: winlogbeat; Version: 5.2.2
2018-02-02T07:39:50Z INFO File output path set to: .\test
2018-02-02T07:39:50Z INFO File output base filename set to: winlogbeat-events.json
2018-02-02T07:39:50Z INFO Rotate every bytes set to: 10485760
2018-02-02T07:39:50Z INFO Number of files set to: 7
2018-02-02T07:39:50Z INFO Activated file as output plugin.
2018-02-02T07:39:50Z INFO Publisher name: F1-D0N343695
2018-02-02T07:39:50Z INFO Flush Interval set to: -1s
2018-02-02T07:39:50Z INFO Max Bulk Size set to: -1
2018-02-02T07:39:50Z INFO State will be read from and persisted to C:\Program Files\winlogbeat\data\test\winlogbeat.yml
2018-02-02T07:39:50Z DBG Using highest priority API, wineventlog, for event log Application
2018-02-02T07:39:50Z DBG Initialized EventLog[Application]
2018-02-02T07:39:50Z INFO winlogbeat start running.
2018-02-02T07:39:50Z INFO Creating C:\Program Files\winlogbeat\data\test if it does not exist.
2018-02-02T07:39:50Z DBG WinEventLog[Application] using subscription query=<QueryList>
<Query Id="0">
<Select Path="Application">*[System[EventID=910]]</Select>
</Query>
</QueryList>
2018-02-02T07:39:50Z DBG EventLog[Application] opened successfully
2018-02-02T07:39:50Z DBG WinEventLog[Application] EventHandles returned 2 handles
2018-02-02T07:39:50Z DBG messageFilesCache[Application] size=1
2018-02-02T07:39:50Z DBG WinEventLog[Application] XML=<Event xmlns='http://schemas.microsoft.com/win/2004/08/events/event'><System><Provider Name='Daviz3DDirector.exe'/><EventID Qualifiers='0'>910</EventID><Level>2</Level><Task>0</Task><Keywords>0x80000000000000</Keywords><TimeCreated SystemTime='2018-02-02T00:58:29.000000000Z'/><EventRecordID>7331656</EventRecordID><Channel>Application</Channel><Computer>F1-D0N343695.national.core.bbc.co.uk</Computer><Security UserID='S-1-5-21-73586283-854245398-682003330-932526'/></System><EventData><Data>Weather Presenter Process was Terminated</Data></EventData><RenderingInfo Culture='en-GB'><Message>Weather Presenter Process was Terminated</Message><Level>Error</Level><Task></Task><Opcode>Info</Opcode><Channel></Channel><Provider></Provider><Keywords><Keyword>Classic</Keyword></Keywords></RenderingInfo></Event>
Enabling debug shouldn't change anything. I think you should investigate downstream next. Can you please share the Logstash configuration you are using.
Try running the same test again but with the Logstash output enabled. In Logstash comment out any filters you are using and add this so that the events are also written to stdout.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.