Skip to content

Loosing events on OpenWEC restart #291

Description

@semyonkozlov

My setup: 1 windows machine (events source), 1 linux machine (events collector - OpenWEC is running here)
Configured successfully and receiving events, but loosing events that were generated during openwec shutdown. Is it expected behavior?

Steps to reproduce:

  1. Creating subscription with filesystem output:
# /etc/openwec.d/03-filesystem.toml
uuid = "e8f232e7-78fa-4fbd-a5af-b8714316b840"
name = "filesystem"

query = """
<QueryList>
    <Query Id="0" Path="Application">
        <Select Path="System">*</Select>
    </Query>
</QueryList>
"""

[options]
read_existing_events = false
max_time = 5

# Subscription outputs
[[outputs]]
driver = "Files"
format = "Json"
config = { path = "/home/openwec/forwarded.log" }

OpenWEC conf:

[[collectors]]
hostname = "wec.server.local"
listen_address = "0.0.0.0"
listen_port = 5985

[collectors.authentication]
type = "Tls"
ca_certificate = "/etc/certs/ca-cert.pem"
server_certificate = "/etc/certs/server-cert.pem"
server_private_key = "/etc/certs/server-key.pem"

[database]
type = "SQLite"
path = "/var/lib/openwec/db/db.sqlite"

[server]
keytab = "/etc/openwec.keytab"

[monitoring]
listen_address = "0.0.0.0"
listen_port = 9090

[logging]
verbosity = "info"
access_logs = "stdout"
  1. Push some events
  2. Verify they are in the file - all good
  3. Shutdown openwecd
  4. Push 50 events from windows machine
for ($i = 0; $i -lt 50; $i++) {
    .\push-event.ps1 $i
}
  1. Launch ./openwecd
  2. Push some new events
  3. The bookmark has moved but no events in the file and there is Direction="backward" (what does it mean?)
$ ./openwec bookmarks show filesystem
winclient.domain.corp:<BookmarkList Direction="backward"><Bookmark Channel="System" RecordId="28251" IsCurrent="true"/></BookmarkList>
  1. Verify there is a gap in the events:
$ cat forwarded.log | jq | grep EventRecordID
  "EventRecordID": 28153,
  "EventRecordID": 28154,
  "EventRecordID": 28155,
  "EventRecordID": 28156,
  "EventRecordID": 28157,
  "EventRecordID": 28158,
  "EventRecordID": 28159,
  "EventRecordID": 28160,
  "EventRecordID": 28161,
  "EventRecordID": 28162,
  "EventRecordID": 28163,
  "EventRecordID": 28164,
  "EventRecordID": 28165,
  "EventRecordID": 28166,
  "EventRecordID": 28167,
  "EventRecordID": 28168,
  "EventRecordID": 28169,
  "EventRecordID": 28170,
  "EventRecordID": 28171,
  "EventRecordID": 28172,
  "EventRecordID": 28173,
  "EventRecordID": 28174,
  "EventRecordID": 28175,
  "EventRecordID": 28176,
  "EventRecordID": 28177,
  "EventRecordID": 28178,
  "EventRecordID": 28179,
  "EventRecordID": 28180,
  "EventRecordID": 28181,
  "EventRecordID": 28251,  <-------------
  "EventRecordID": 28252,
  "EventRecordID": 28253,
  "EventRecordID": 28254,

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions