diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 98765e31954..b0692fcaf05 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -390,6 +390,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d - Fix instance name in perfmon metricset. {issue}22218[22218] {pull}22261[22261] - Remove io.time from windows {pull}22237[22237] - Add interval information to `monitor` metricset in azure. {pull}22152[22152] +- Change Session ID type from int to string {pull}22359[22359] *Packetbeat* @@ -843,4 +844,3 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d *Journalbeat* - diff --git a/metricbeat/module/system/users/dbus.go b/metricbeat/module/system/users/dbus.go index 03dbc9fc3a7..3d8177f3d76 100644 --- a/metricbeat/module/system/users/dbus.go +++ b/metricbeat/module/system/users/dbus.go @@ -48,7 +48,7 @@ type sessionInfo struct { // loginSession contains basic information on a login session type loginSession struct { - ID uint64 + ID string UID uint32 User string Seat string @@ -167,16 +167,11 @@ func formatSessionList(props [][]dbus.Variant) ([]loginSession, error) { if len(session) < 5 { return nil, fmt.Errorf("wrong number of fields in session: %v", session) } - idStr, ok := session[0].Value().(string) + id, ok := session[0].Value().(string) if !ok { return nil, fmt.Errorf("failed to cast user ID to string") } - id, err := strconv.ParseUint(idStr, 10, 32) - if err != nil { - return nil, errors.Wrap(err, "error parsing ID to int") - } - uid, ok := session[1].Value().(uint32) if !ok { return nil, fmt.Errorf("failed to cast session uid to uint32") diff --git a/metricbeat/module/system/users/users_test.go b/metricbeat/module/system/users/users_test.go index 50de07a6eee..11a6a09bdee 100644 --- a/metricbeat/module/system/users/users_test.go +++ b/metricbeat/module/system/users/users_test.go @@ -61,7 +61,7 @@ func TestFormatSessionList(t *testing.T) { } goodOut := []loginSession{{ - ID: uint64(6), + ID: "6", UID: uint32(1000), User: "user", Seat: "",