Skip to content

Adding macOS unified logging source to collectors#26542

Open
kroepke wants to merge 26 commits into
masterfrom
feat/macos-unified-logging-receiver
Open

Adding macOS unified logging source to collectors#26542
kroepke wants to merge 26 commits into
masterfrom
feat/macos-unified-logging-receiver

Conversation

@kroepke

@kroepke kroepke commented Jul 1, 2026

Copy link
Copy Markdown
Member

Description

With Graylog2/collector#74 we can support native macOS unified logger sources again.

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (non-breaking change)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have requested a documentation update.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

kroepke and others added 14 commits June 30, 2026 18:21
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…index type consistency

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
expose more settings to the ui
but hide archive_path and end_time, as those would essentially be one-shot collection
they would technically work but are not a good fit for our use case. the receiver has support, be graylog doesn't at this point
@kroepke
kroepke marked this pull request as ready for review July 14, 2026 15:09
@kroepke
kroepke requested review from a team and Copilot July 14, 2026 15:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds end-to-end support for a new Collector source type, macos_unified_logging, enabling Graylog fleets to configure and ingest macOS Unified Logging data (aligned with the collector-side receiver reintroduction).

Changes:

  • Extends the web UI Collector source model and creation/edit form to support macos_unified_logging (predicate, start time, and optional durations).
  • Adds server-side source/receiver config models plus a log record processor that maps macos.* OTel attributes into GIM fields.
  • Updates onboarding defaults and test fixtures to include the new source and validate serialization/processing behavior.

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
graylog2-web-interface/src/components/collectors/types.ts Adds the new macos_unified_logging source type and config typing.
graylog2-web-interface/src/components/collectors/sources/SourceFormModal.tsx Adds form fields and duration handling for macOS unified logging sources.
graylog2-web-interface/src/components/collectors/sources/SourceFormModal.test.tsx Adds UI tests covering macOS source field rendering and saved config.
graylog2-web-interface/src/components/collectors/sources/Constants.ts Adds label for macos_unified_logging in the source type selector.
graylog2-web-interface/src/components/collectors/sources/ColumnRenderers.tsx Widens the source type column to fit the new label.
graylog2-web-interface/src/components/collectors/overview/onboarding/defaultSources.ts Adds a default “macOS Unified Logs” onboarding source template.
graylog2-web-interface/src/components/collectors/overview/FleetCardsGrid.tsx Adjusts grid sizing to accommodate updated onboarding/cards layout.
graylog2-web-interface/src/components/collectors/overview/FirstOnboarding.test.tsx Updates expectations to account for the additional default source.
graylog2-server/src/test/resources/org/graylog/collectors/input/processor/macos-unified-log-record.json Adds an OTel fixture record representing macOS unified logging attributes.
graylog2-server/src/test/java/org/graylog/collectors/input/processor/MacOSUnifiedLoggingRecordProcessorTest.java Adds unit tests for macOS record-to-field mapping and fixture parsing.
graylog2-server/src/test/java/org/graylog/collectors/db/SourceDTOTest.java Registers the new subtype for DTO JSON round-trip tests.
graylog2-server/src/test/java/org/graylog/collectors/db/SourceConfigTest.java Adds round-trip + receiver-config tests for the new source config fields.
graylog2-server/src/test/java/org/graylog/collectors/config/receiver/MacOSUnifiedLoggingReceiverConfigTest.java Tests receiver defaults and serialization behavior.
graylog2-server/src/main/java/org/graylog/collectors/input/processor/MacOSUnifiedLoggingRecordProcessor.java Implements mapping of macos.* attributes into GIM + macOS-prefixed fields.
graylog2-server/src/main/java/org/graylog/collectors/db/MacOSUnifiedLoggingSourceConfig.java Adds new persisted source config and conversion to receiver config.
graylog2-server/src/main/java/org/graylog/collectors/config/receiver/MacOSUnifiedLoggingReceiverConfig.java Adds the receiver config model with defaults and Go-duration serialization.
graylog2-server/src/main/java/org/graylog/collectors/CollectorsModule.java Wires the new source subtype and record processor binding into the server module.
changelog/unreleased/pr-26542.toml Adds an unreleased changelog entry for the new source type.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@bernd bernd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First round of review.

Comment thread changelog/unreleased/pr-26542.toml Outdated
Comment thread changelog/unreleased/pr-26542.toml Outdated
Comment on lines +262 to +279
<TimeUnitInput
label="Max poll interval"
update={updateDuration('max_poll_interval')}
value={pollInterval.duration}
unit={pollInterval.unit}
units={POLL_INTERVAL_UNITS}
enabled={config.max_poll_interval !== undefined}
help="Optional. How often the Collector checks for new log entries. Leave unchecked to use the default (30s)."
/>
<TimeUnitInput
label="Max log age"
update={updateDuration('max_log_age')}
value={logAge.duration}
unit={logAge.unit}
units={LOG_AGE_UNITS}
enabled={config.max_log_age !== undefined}
help="Optional. On first start, how far back to backfill logs. Leave unchecked to use the default (24h)."
/>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should use the <TimeUnitInput/> component for both values and set the default values. I don't think we need the checkbox. Just adding the default values should be enough.

Component usage in events system configuration:

Image

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, much cleaner and I added more sensible validations, too.

return (
<>
<Input
id="macos-predicate"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we just add the default predicate here? That makes the "secure default" visible for users.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, adding it to the default config section in this file, rather than in the backend.

Comment thread graylog2-web-interface/src/components/collectors/types.ts Outdated
kroepke and others added 6 commits July 22, 2026 11:33
Co-authored-by: Bernd Ahlers <bernd@users.noreply.github.com>
Co-authored-by: Bernd Ahlers <bernd@users.noreply.github.com>
… required

start_date is no longer set, we only need max_log_age as the relative starting point and calculate `--start` values in the collector
the predicate default now lives in the frontend only, the backend allows empty predicates (valid but probably impractical settings)

improved validation for max_poll_interval and max_log_age in both frontend and backend
@kroepke
kroepke requested a review from bernd July 22, 2026 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants