{
  "changes": [],
  "conditions": [],
  "fieldGroups": [
    {
      "id": "event",
      "title": "Event"
    },
    {
      "id": "sleep",
      "title": "Sleep"
    },
    {
      "id": "boot_shutdown",
      "title": "Boot and shutdown"
    },
    {
      "id": "clock_step",
      "title": "Clock step"
    }
  ],
  "fieldPrefix": "sparklogs.data.lifecycle.",
  "fields": [
    {
      "doc": "Lifecycle subject: os or agent.",
      "group": "event",
      "name": "subject_kind",
      "type": "string"
    },
    {
      "doc": "Lifecycle transition.",
      "group": "event",
      "name": "transition",
      "type": "string"
    },
    {
      "doc": "Physical uptime at the occurrence, omitted when unknown.",
      "group": "event",
      "name": "boot_elapsed_s",
      "type": "integer"
    },
    {
      "doc": "Awake time at the occurrence as the reporting agent process reads it, omitted when unknown. Comparable only between rows from one agent process: a restarted agent can read seconds, or a whole Fast Startup, more than its predecessor.",
      "group": "event",
      "name": "awake_s",
      "type": "integer"
    },
    {
      "doc": "Suspend, hibernate or low power idle.",
      "group": "sleep",
      "name": "sleep_kind",
      "type": "string"
    },
    {
      "doc": "Native power state the sleep reached: `S3` or `S4` when the kernel's sleep-entry record (Kernel-Power 42) gives that effective state, `S0ix` for a low power idle span (reported only when its awake clock stopped); omitted for a suspend or hibernate without that record.",
      "group": "sleep",
      "name": "sleep_state_native",
      "type": "string"
    },
    {
      "doc": "Native reason the Modern Standby session began, from the kernel's standby-entry record (Kernel-Power 506 `Reason`: 1 power button, 11 sleep request, 12 display idle timeout, 15 lid, 55 battery budget); low power idle only, omitted without that record.",
      "group": "sleep",
      "name": "sleep_reason_native",
      "type": "integer"
    },
    {
      "doc": "Seconds the machine spent asleep in the span: boot time minus awake time, both read by one agent process; omitted when its awake clock gave no reading.",
      "group": "sleep",
      "name": "asleep_s",
      "type": "integer"
    },
    {
      "doc": "Update, OS shutdown, operator or error.",
      "group": "boot_shutdown",
      "name": "stop_cause",
      "type": "string"
    },
    {
      "doc": "Previous last-alive evidence, not exact crash time; a pre-engine crash can leave older evidence with no fixed error bound.",
      "group": "boot_shutdown",
      "name": "stopped_ts",
      "type": "string",
      "unit": "timestamp"
    },
    {
      "doc": "What dated the occurrence, which is last-alive evidence and not the exact crash time. `event_log`: the power button time in the kernel's unclean-reboot record (Kernel-Power 41), after a long press. `agent_tick`: the agent's last recorded observation. `latest_record`: on a row rebuilt from the System log, the latest record written before the boot that followed. Guards and the cleared-as-clean cases: `docs/engineering/clocks-and-observation.md`.",
      "group": "boot_shutdown",
      "name": "last_alive_basis",
      "type": "string"
    },
    {
      "doc": "Estimated current boot instant.",
      "group": "boot_shutdown",
      "name": "booted_ts",
      "type": "string",
      "unit": "timestamp"
    },
    {
      "doc": "True on the `host_shutdown` and `host_booted` pair a Fast Startup raises: the kernel's sleep-entry record targeted shutdown and reached hibernate (Kernel-Power 42 `TargetState` 6, `EffectiveState` 5) and the resume booted as Fast Startup (Kernel-Boot 27 `BootType` 1). The agent process and its uptime survive it, so `boot_elapsed_s` and `awake_s` keep counting from the earlier boot; on a pair rebuilt from the System log they are omitted. Omitted otherwise.",
      "group": "boot_shutdown",
      "name": "fast_startup",
      "type": "bool"
    },
    {
      "doc": "Signed seconds the wall clock moved against the boot clock, forward positive; the time a forward step skipped was not observed.",
      "group": "clock_step",
      "name": "step_s",
      "type": "integer"
    },
    {
      "doc": "Wall time just before the clock step, on the old clock.",
      "group": "clock_step",
      "name": "old_ts",
      "type": "string",
      "unit": "timestamp"
    },
    {
      "doc": "Wall time just after the clock step, on the new clock.",
      "group": "clock_step",
      "name": "new_ts",
      "type": "string",
      "unit": "timestamp"
    },
    {
      "doc": "What measured the step: `tick_pair`, two of the agent's own clock readings, 10 s apart while the agent samples performance and otherwise up to one capture interval apart (60 s by default), so `old_ts` and `new_ts` place the step at the later reading, up to that interval after it happened.",
      "group": "clock_step",
      "name": "step_source",
      "type": "string"
    }
  ],
  "name": "Host and agent lifecycle",
  "occurrences": [
    {
      "code": "host_booted",
      "consider": [
        "The event before it: a clean shutdown or an unexpected one.",
        "User32 event 1074 in the System log, which SparkLogs also collects, names the program and account that asked for the restart and the reason given.",
        "Whether the machine restarts more often than its patch schedule explains."
      ],
      "explanation": "The event is dated to when Windows started. The event before it says how the last run ended: Host shutting down for a clean shutdown, Unexpected host shutdown for a crash, a power loss or a reset. A start marked Fast Startup followed the default Shut down on most Windows 10 and 11 PCs: Windows restored a saved kernel, so it was not a full restart, and a driver fault that a restart clears can survive it. Restarts while the agent was not running are read back from the System log when it starts again.",
      "impact": "A restart nobody planned means users lost open work and the machine's services were down while it restarted.",
      "label": "Host booted",
      "scenario": "An office desktop boots again three minutes after restarting for its monthly updates.",
      "summary": "The machine started, after a restart, a power-on, or a Fast Startup."
    },
    {
      "code": "host_clock_stepped",
      "consider": [
        "The size and direction of the jump in the event, and the clock time on either side.",
        "`w32tm /query /source` and `w32tm /query /status` show where Windows takes its time from and when it last synchronized.",
        "On a virtual machine, whether the hypervisor's time sync and domain time both set the clock."
      ],
      "explanation": "Windows Time correcting a drifted clock, an administrator setting the time, or a virtual machine catching up after the hypervisor paused or restored it is the usual cause. Sleep does not count: the clock moving across a sleep is not a jump. Repeated large jumps point at a bad time source, two sources setting the clock (domain time and the hypervisor's time sync on a virtual machine), or a failing motherboard clock battery. Windows Time failing to reach its source is reported separately, from the System log.",
      "impact": "Log times on either side of the jump do not line up with each other or with other machines. Before a large correction the clock was off by that much, and Kerberos rejects sign-ins from a clock more than five minutes from the domain controller's, the Windows default.",
      "label": "Host clock stepped",
      "scenario": "Windows Time pulls a laptop's clock back four minutes after it ran fast.",
      "summary": "The machine's clock jumped forward or back by ten seconds or more."
    },
    {
      "code": "host_resume_settled",
      "consider": [
        "A problem raised soon after this point that was not there before the sleep: the power-management settings and recent updates of the network, storage and graphics drivers."
      ],
      "explanation": "After a wake from sleep, the agent waits a short time before it judges performance, disk and network readings, so the burst of activity that follows every resume does not open conditions. This marks when the last of those waits ended.",
      "impact": "A performance, disk or network problem raised after this point is not the burst of activity that follows a wake.",
      "label": "Host resume settled",
      "scenario": "A laptop settles 15 seconds after resuming from a night's sleep.",
      "summary": "The agent's short wait after a wake from sleep ended."
    },
    {
      "code": "host_shutdown",
      "consider": [
        "User32 event 1074 in the System log, which SparkLogs also collects, names the program and account that asked for it and the reason given.",
        "The time to the next Host booted: how long the machine was down."
      ],
      "explanation": "Windows tells running services the machine is going down, for a restart, a shut down or a Fast Startup shut down, and the event is dated from that notice. It does not say whether the machine restarted or powered off: the next Host booted, and how long until it, does. A clean run ends with this event before the next Host booted, and a start without one is reported as Unexpected host shutdown.",
      "impact": "Users' sessions and the machine's services stop, and a server stays unavailable until it starts again.",
      "label": "Host shutting down",
      "scenario": "An office desktop shuts down cleanly to restart for its monthly updates.",
      "summary": "Windows began shutting down or restarting the machine."
    },
    {
      "code": "host_sleep_entered",
      "consider": [
        "The type of sleep and, for Modern Standby, the reason in the event.",
        "The power plan's sleep and hibernate timeouts, in Settings or `powercfg /query`."
      ],
      "explanation": "SparkLogs reports a sleep when the machine wakes, dated to when it went to sleep, so a machine that is still asleep has no sleep event yet. Sleeps shorter than thirty seconds do not count, and a virtual machine that the hypervisor pauses or saves is not reported as asleep. For Modern Standby the event says what started it: the lid, the power button, a sleep request, the display timeout or the battery. A server, or a machine that should run overnight jobs, going to sleep points at its power plan.",
      "impact": "While asleep the machine runs no scheduled tasks, backups or patching, and remote support cannot reach it.",
      "label": "Host entered sleep",
      "scenario": "An accountant closes a laptop's lid, and it sleeps for fourteen hours.",
      "summary": "The machine went to sleep, into Modern Standby, or into hibernation."
    },
    {
      "code": "host_sleep_exited",
      "consider": [
        "`powercfg /lastwake`, or Power-Troubleshooter event 1 in the System log, which SparkLogs also collects, names what woke the machine after classic sleep or hibernation.",
        "Driver updates for the device that fails after a wake, and the \"Allow the computer to turn off this device to save power\" setting on its Power Management tab in Device Manager."
      ],
      "explanation": "The event carries how long the machine was asleep. Problems that start right after a wake are often a driver's power management at fault, and this event dates them. Repeated wakes with nobody at the machine are the Power wake loop condition.",
      "impact": "A driver that mishandles the wake leaves users with no Wi-Fi, a black screen, or a dock, display or USB device that stops working until a restart.",
      "label": "Host resumed",
      "scenario": "The laptop resumes the next morning after fourteen hours asleep.",
      "summary": "The machine woke from sleep, Modern Standby or hibernation."
    },
    {
      "code": "host_unexpected_shutdown",
      "consider": [
        "A Windows crashed (blue screen) event near the restart: start from its bug check code.",
        "Repeats with no blue screen: the power supply, UPS, power cable or battery, and overheating.",
        "On a virtual machine, the hypervisor's log for a reset or a host failure."
      ],
      "explanation": "A blue screen, a power loss, a held power button, a dead battery, or a hypervisor resetting the virtual machine ends a run this way. The event carries the last time the machine was known to be running, and the failure came after it, sometimes well after. SparkLogs also reports the System log's own records of the same failure (event 6008 and Kernel-Power 41) as a separate unexpected shutdown event. A failure while the agent was not running is read back from the System log when it starts again.",
      "impact": "Users lost unsaved work, open files and databases may need repair, and the machine's services were down from the failure until it came back.",
      "label": "Unexpected host shutdown",
      "scenario": "A laptop's worn battery dies without warning, and the laptop is dark for twenty minutes.",
      "severityText": "Warning on a server, Display on a workstation.",
      "summary": "The machine started again with no record that it shut down cleanly."
    },
    {
      "code": "sparklogs_agent_started",
      "consider": [
        "The previous SparkLogs agent stopped event and its cause, or an Unexpected host shutdown before this start.",
        "Notice starts that repeat with no machine failure behind them: report them to SparkLogs support with the device name."
      ],
      "explanation": "The agent starts with Windows, after its own update, or when someone starts the service. A start whose previous run left no stop record means the agent crashed, was ended, or went down with the machine. An Unexpected host shutdown just before it says it was the machine.",
      "impact": "The agent took no performance or device readings between its last stop and this start.",
      "label": "SparkLogs agent started",
      "scenario": "The agent starts with Windows on an office desktop.",
      "severityText": "Notice when the agent's previous run ended without recording its stop, Display otherwise.",
      "summary": "The SparkLogs agent started."
    },
    {
      "code": "sparklogs_agent_stopped",
      "consider": [
        "The cause in the event, and for a stop by someone, which administrator or RMM policy stopped it.",
        "The time to the next SparkLogs agent started: how long the machine had no readings.",
        "Repeated error stops: report them to SparkLogs support with the device name."
      ],
      "explanation": "The event names the cause: an agent update, Windows shutting down, someone stopping the service (an administrator, an RMM tool or an uninstall), or an error inside the agent. When the agent dies without stopping, the Service Control Manager records it in the System log, and SparkLogs reports that record under this reason at Error.",
      "impact": "The agent takes no device or performance readings until it starts again. After a crash, logs keep arriving. After an update, a shutdown or someone stopping the service, logs written in the gap arrive once collection starts again. They are lost if the agent is uninstalled or never started again. Event log records can also be lost if Windows overwrites them before the agent starts again; the agent then reports them as skipped events.",
      "label": "SparkLogs agent stopped",
      "scenario": "Windows stops the agent as an office desktop shuts down to install its monthly updates.",
      "severityText": "Notice when the agent stopped on an error, Display for an update, a shutdown, or someone stopping the service.",
      "summary": "The SparkLogs agent stopped."
    }
  ],
  "page": "/docs/it-fleet-intelligence/reference/topics/lifecycle",
  "status": "live",
  "summary": "Boots, shutdowns, sleep and wake, and agent starts and stops, each dated when it happened.",
  "topic": "lifecycle"
}
