You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by ho...@apache.org on 2026/10/15 08:11:06 UTC

(streampipes) 01/06: first draft

This is an automated email from the ASF dual-hosted git repository.

JHoelli pushed a commit to branch 5092-add-export-feature-to-audit-logs
in repository https://gitbox.apache.org/repos/asf/streampipes.git

commit 2883709782691e10af793a427cf9ad03bc07d93f
Author: Jacqueline Höllig <j....@gmx.net>
AuthorDate: Thu Oct 15 08:57:13 2026 +0200

    first draft
---
 ui/deployment/i18n/de.json                         |   9 ++
 ui/deployment/i18n/en.json                         |   9 ++
 ui/deployment/i18n/pl.json                         |   9 ++
 .../audit-log/audit-download-dialog.component.html | 111 +++++++++++++++
 .../audit-log/audit-download-dialog.component.scss |  33 +++++
 .../audit-log/audit-download-dialog.component.ts   | 151 +++++++++++++++++++++
 .../audit-log/audit-log.component.html             |  10 ++
 .../audit-log/audit-log.component.spec.ts          |  17 +++
 .../configuration/audit-log/audit-log.component.ts |  13 ++
 9 files changed, 362 insertions(+)

diff --git a/ui/deployment/i18n/de.json b/ui/deployment/i18n/de.json
index d6e7371b5a..21f6ebdc8b 100644
--- a/ui/deployment/i18n/de.json
+++ b/ui/deployment/i18n/de.json
@@ -134,6 +134,7 @@
   "Assign additional labels to better discover your assets": "Weisen Sie zusätzliche Labels zu, um Ihre Assets besser zu finden",
   "Attach adapters, dashboards, or pipelines in the asset editor to surface them here.": "Fügen Sie Adapter, Dashboards oder Pipelines im Asset-Editor hinzu, um sie hier anzuzeigen.",
   "Audit Log": "Audit-Protokoll",
+  "Audit events could not be downloaded. Try again.": "Audit-Ereignisse konnten nicht heruntergeladen werden. Versuche es erneut.",
   "Audit events could not be loaded. Check the filters and storage availability, then retry.": "Audit-Ereignisse konnten nicht geladen werden. Prüfe die Filter und die Speicherverfügbarkeit und versuche es erneut.",
   "Audit pages": "Audit-Seiten",
   "Audit recording is disabled. Enable auditing in the Core deployment configuration.": "Die Audit-Aufzeichnung ist deaktiviert. Aktiviere sie in der Bereitstellungskonfiguration des Core.",
@@ -210,6 +211,7 @@
   "Choose existing file": "Vorhandene Datei auswählen",
   "Choose target dataset": "Ziel-Dataset auswählen",
   "Choose template": "Vorlage auswählen",
+  "Choose the columns to include in the export.": "Wähle die Spalten aus, die in den Export aufgenommen werden sollen.",
   "Choose the new location for this asset.": "Wählen Sie den neuen Speicherort für dieses Asset.",
   "Clamp to 0-100%": "Auf 0-100 % begrenzen",
   "Clean code": "Code aufräumen",
@@ -233,7 +235,9 @@
   "Color used above the high threshold.": "Farbe, die oberhalb des hohen Schwellenwerts verwendet wird.",
   "Color used between low and high thresholds.": "Farbe, die zwischen niedrigem und hohem Schwellenwert verwendet wird.",
   "Color used from min up to the low threshold.": "Farbe, die von Min bis zum niedrigen Schwellenwert verwendet wird.",
+  "Columns": "Spalten",
   "Compatible Elements": "Kompatible Elemente",
+  "Complete": "Abgeschlossen",
   "Configuration": "Konfiguration",
   "Configuration required": "Konfiguration erforderlich",
   "Configure Element": "Element konfigurieren",
@@ -396,8 +400,10 @@
   "Download": "Download",
   "Download File": "Datei herunterladen",
   "Download Format": "Download-Format",
+  "Download audit log": "Audit-Protokoll herunterladen",
   "Download data": "Daten herunterladen",
   "Download export": "Export herunterladen",
+  "Download started": "Download gestartet",
   "Download successful": "Download erfolgreich",
   "Dropped events": "Verworfene Ereignisse",
   "Edge": "Rand",
@@ -475,6 +481,7 @@
   "Export Settings": "Export-Einstellungen",
   "Export all documents": "Alle Dokumente exportieren",
   "Export assets and all linked resources": "Assets und alle damit verbundenen Ressourcen exportieren",
+  "Export audit log": "Audit-Protokoll exportieren",
   "Export resources": "Ressourcen exportieren",
   "Exporting resources...": "Ressourcen exportieren...",
   "Fail": "Fehlgeschlagen",
@@ -1188,6 +1195,7 @@
   "The CSV import failed.": "Der CSV-Import ist fehlgeschlagen.",
   "The ISA95 type of this asset": "Der ISA95-Typ dieser Anlage",
   "The URL where the application can be accessed, e.g., for links in emails.": "Die URL, unter der die Anwendung aufgerufen werden kann, z. B. für Links in E-Mails.",
+  "The active audit-log filters and selected columns will be exported as a CSV file.": "Die aktiven Audit-Protokoll-Filter und ausgewählten Spalten werden als CSV-Datei exportiert.",
   "The adapter is currently used by these pipelines:": "Der Adapter wird derzeit von diesen Pipelines verwendet:",
   "The app name as shown on the login screen and in emails": "Der Name der Anwendung, wie er auf dem Anmeldebildschirm und in E-Mails angezeigt wird",
   "The base URL": "Die Base-URL",
@@ -1387,6 +1395,7 @@
   "You need to delete those pipelines first before deleting the adapter.": "Sie müssen diese Pipelines zuerst löschen, bevor Sie den Adapter löschen können.",
   "Your Assets were successfully added.": "Assets erfolgreich hinzugefügt.",
   "Your Assets were successfully deleted.": "Assets erfolgreich gelöscht.",
+  "Your audit log is being downloaded.": "Dein Audit-Protokoll wird heruntergeladen.",
   "Your new API key has been created. Please copy the key now - you won't be able to see the key again.": "Ihr neuer API-Schlüssel wurde erstellt. Bitte kopieren Sie den Schlüssel jetzt - Sie werden ihn nicht mehr sehen können.",
   "Your new data stream is now available in the pipeline editor.": "Ihr neuer Datenstrom ist nun im Pipeline-Editor verfügbar.",
   "Your password successfully changed.": "Ihr Passwort wurde erfolgreich geändert.",
diff --git a/ui/deployment/i18n/en.json b/ui/deployment/i18n/en.json
index 93b8960cfb..7fe47e0e4e 100644
--- a/ui/deployment/i18n/en.json
+++ b/ui/deployment/i18n/en.json
@@ -134,6 +134,7 @@
   "Assign additional labels to better discover your assets": null,
   "Attach adapters, dashboards, or pipelines in the asset editor to surface them here.": null,
   "Audit Log": "Audit Log",
+  "Audit events could not be downloaded. Try again.": null,
   "Audit events could not be loaded. Check the filters and storage availability, then retry.": "Audit events could not be loaded. Check the filters and storage availability, then retry.",
   "Audit pages": "Audit pages",
   "Audit recording is disabled. Enable auditing in the Core deployment configuration.": "Audit recording is disabled. Enable auditing in the Core deployment configuration.",
@@ -210,6 +211,7 @@
   "Choose existing file": null,
   "Choose target dataset": null,
   "Choose template": null,
+  "Choose the columns to include in the export.": null,
   "Choose the new location for this asset.": "Choose the new location for this asset.",
   "Clamp to 0-100%": null,
   "Clean code": null,
@@ -233,7 +235,9 @@
   "Color used above the high threshold.": null,
   "Color used between low and high thresholds.": null,
   "Color used from min up to the low threshold.": null,
+  "Columns": null,
   "Compatible Elements": null,
+  "Complete": null,
   "Configuration": null,
   "Configuration required": null,
   "Configure Element": null,
@@ -396,8 +400,10 @@
   "Download": null,
   "Download File": null,
   "Download Format": null,
+  "Download audit log": null,
   "Download data": null,
   "Download export": null,
+  "Download started": null,
   "Download successful": null,
   "Dropped events": "Dropped events",
   "Edge": null,
@@ -475,6 +481,7 @@
   "Export Settings": null,
   "Export all documents": null,
   "Export assets and all linked resources": null,
+  "Export audit log": null,
   "Export resources": null,
   "Exporting resources...": null,
   "Fail": null,
@@ -1188,6 +1195,7 @@
   "The CSV import failed.": null,
   "The ISA95 type of this asset": null,
   "The URL where the application can be accessed, e.g., for links in emails.": null,
+  "The active audit-log filters and selected columns will be exported as a CSV file.": null,
   "The adapter is currently used by these pipelines:": null,
   "The app name as shown on the login screen and in emails": null,
   "The base URL": null,
@@ -1387,6 +1395,7 @@
   "You need to delete those pipelines first before deleting the adapter.": null,
   "Your Assets were successfully added.": null,
   "Your Assets were successfully deleted.": null,
+  "Your audit log is being downloaded.": null,
   "Your new API key has been created. Please copy the key now - you won't be able to see the key again.": null,
   "Your new data stream is now available in the pipeline editor.": null,
   "Your password successfully changed.": null,
diff --git a/ui/deployment/i18n/pl.json b/ui/deployment/i18n/pl.json
index 155a9a312a..96ffdc1915 100644
--- a/ui/deployment/i18n/pl.json
+++ b/ui/deployment/i18n/pl.json
@@ -134,6 +134,7 @@
   "Assign additional labels to better discover your assets": "Przypisz dodatkowe etykiety, aby łatwiej odnajdywać zasoby",
   "Attach adapters, dashboards, or pipelines in the asset editor to surface them here.": "Dołącz adaptery, pulpity lub strumienie w edytorze zasobu, aby wyświetlały się tutaj.",
   "Audit Log": "Dziennik audytu",
+  "Audit events could not be downloaded. Try again.": "Nie udało się pobrać zdarzeń audytu. Spróbuj ponownie.",
   "Audit events could not be loaded. Check the filters and storage availability, then retry.": "Nie udało się wczytać zdarzeń audytu. Sprawdź filtry i dostępność magazynu, a następnie spróbuj ponownie.",
   "Audit pages": "Strony audytu",
   "Audit recording is disabled. Enable auditing in the Core deployment configuration.": "Rejestrowanie audytu jest wyłączone. Włącz je w konfiguracji wdrożenia Core.",
@@ -210,6 +211,7 @@
   "Choose existing file": "Wybierz istniejący plik",
   "Choose target dataset": "Wybierz docelowy zbiór danych",
   "Choose template": "Wybierz szablon",
+  "Choose the columns to include in the export.": "Wybierz kolumny, które mają zostać uwzględnione w eksporcie.",
   "Choose the new location for this asset.": "Wybierz nową lokalizację tego zasobu.",
   "Clamp to 0-100%": "Ogranicz do 0-100%",
   "Clean code": "Wyczyść kod",
@@ -233,7 +235,9 @@
   "Color used above the high threshold.": "Kolor używany powyżej wysokiego progu.",
   "Color used between low and high thresholds.": "Kolor używany między niskim a wysokim progiem.",
   "Color used from min up to the low threshold.": "Kolor używany od minimum do niskiego progu.",
+  "Columns": "Kolumny",
   "Compatible Elements": "Kompatybilne elementy",
+  "Complete": "Zakończono",
   "Configuration": "Konfiguracja",
   "Configuration required": "Wymagana konfiguracja",
   "Configure Element": "Skonfiguruj element",
@@ -396,8 +400,10 @@
   "Download": "Pobierz",
   "Download File": "Pobierz plik",
   "Download Format": "Format pobierania",
+  "Download audit log": "Pobierz dziennik audytu",
   "Download data": "Pobierz dane",
   "Download export": "Pobierz eksport",
+  "Download started": "Pobieranie rozpoczęte",
   "Download successful": "Pobieranie zakończone powodzeniem",
   "Dropped events": "Odrzucone zdarzenia",
   "Edge": "Krawędź",
@@ -475,6 +481,7 @@
   "Export Settings": "Ustawienia eksportu",
   "Export all documents": "Eksportuj wszystkie dokumenty",
   "Export assets and all linked resources": "Eksportuj zasoby i wszystkie powiązane zasoby",
+  "Export audit log": "Eksportuj dziennik audytu",
   "Export resources": "Eksportuj zasoby",
   "Exporting resources...": "Eksportowanie zasobów...",
   "Fail": "Niepowodzenie",
@@ -1188,6 +1195,7 @@
   "The CSV import failed.": "Import CSV nie powiódł się.",
   "The ISA95 type of this asset": "Typ ISA95 tego zasobu",
   "The URL where the application can be accessed, e.g., for links in emails.": "Adres URL, pod którym dostępna jest aplikacja, np. do linków w e-mailach.",
+  "The active audit-log filters and selected columns will be exported as a CSV file.": "Aktywne filtry dziennika audytu i wybrane kolumny zostaną wyeksportowane jako plik CSV.",
   "The adapter is currently used by these pipelines:": "Adapter jest obecnie używany przez następujące strumienie:",
   "The app name as shown on the login screen and in emails": "Nazwa aplikacji wyświetlana na ekranie logowania i w wiadomościach e-mail",
   "The base URL": "Bazowy URL",
@@ -1387,6 +1395,7 @@
   "You need to delete those pipelines first before deleting the adapter.": "Przed usunięciem adaptera najpierw usuń te strumienie.",
   "Your Assets were successfully added.": "Twoje zasoby zostały pomyślnie dodane.",
   "Your Assets were successfully deleted.": "Twoje zasoby zostały pomyślnie usunięte.",
+  "Your audit log is being downloaded.": "Twój dziennik audytu jest pobierany.",
   "Your new API key has been created. Please copy the key now - you won't be able to see the key again.": "Twój nowy klucz API został utworzony. Skopiuj go teraz - później nie będzie już widoczny.",
   "Your new data stream is now available in the pipeline editor.": "Twój nowy strumień danych jest teraz dostępny w edytorze strumieńów.",
   "Your password successfully changed.": "Twoje hasło zostało pomyślnie zmienione.",
diff --git a/ui/src/app/configuration/audit-log/audit-download-dialog.component.html b/ui/src/app/configuration/audit-log/audit-download-dialog.component.html
new file mode 100644
index 0000000000..0a02761d06
--- /dev/null
+++ b/ui/src/app/configuration/audit-log/audit-download-dialog.component.html
@@ -0,0 +1,111 @@
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements.  See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You under the Apache License, Version 2.0
+  ~ (the "License"); you may not use this file except in compliance with
+  ~ the License.  You may obtain a copy of the License at
+  ~
+  ~    http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  ~
+  -->
+
+<div class="sp-dialog-container">
+    <div class="sp-dialog-content">
+        <mat-horizontal-stepper #stepper>
+            <mat-step>
+                <section class="audit-download-columns">
+                    <h3>{{ 'Columns' | translate }}</h3>
+                    <p>
+                        {{
+                            'Choose the columns to include in the export.'
+                                | translate
+                        }}
+                    </p>
+                    @for (column of columns; track column.id) {
+                        <mat-checkbox [(ngModel)]="column.selected">
+                            {{ column.label | translate }}
+                        </mat-checkbox>
+                    }
+                </section>
+                <ng-template matStepLabel>{{
+                    'Select Data' | translate
+                }}</ng-template>
+            </mat-step>
+            <mat-step>
+                <section class="audit-download-ready">
+                    <mat-icon>description</mat-icon>
+                    <h3>{{ 'Export audit log' | translate }}</h3>
+                    <p>
+                        {{
+                            'The active audit-log filters and selected columns will be exported as a CSV file.'
+                                | translate
+                        }}
+                    </p>
+                    @if (downloading) {
+                        <mat-spinner diameter="24" />
+                    }
+                    @if (downloadFailed) {
+                        <p class="audit-download-error" role="alert">
+                            {{
+                                'Audit events could not be downloaded. Try again.'
+                                    | translate
+                            }}
+                        </p>
+                    }
+                </section>
+                <ng-template matStepLabel>{{
+                    'Download' | translate
+                }}</ng-template>
+            </mat-step>
+            <mat-step>
+                <section class="audit-download-ready">
+                    <mat-icon>check_circle</mat-icon>
+                    <h3>{{ 'Download started' | translate }}</h3>
+                    <p>
+                        {{ 'Your audit log is being downloaded.' | translate }}
+                    </p>
+                </section>
+                <ng-template matStepLabel>{{
+                    'Complete' | translate
+                }}</ng-template>
+            </mat-step>
+        </mat-horizontal-stepper>
+    </div>
+
+    <mat-divider />
+    <div class="sp-dialog-actions actions-align-left">
+        <button mat-button class="mat-basic" (click)="close()">
+            {{ 'Close' | translate }}
+        </button>
+        @if (stepper.selectedIndex === 0) {
+            <button
+                mat-flat-button
+                color="accent"
+                [disabled]="!hasSelectedColumns"
+                (click)="stepper.next()"
+            >
+                {{ 'Next' | translate }}
+            </button>
+        }
+        @if (stepper.selectedIndex === 1) {
+            <button mat-button class="mat-basic" (click)="stepper.previous()">
+                {{ 'Previous' | translate }}
+            </button>
+            <button
+                mat-flat-button
+                color="accent"
+                [disabled]="downloading"
+                (click)="download(stepper)"
+            >
+                {{ 'Download' | translate }}
+            </button>
+        }
+    </div>
+</div>
diff --git a/ui/src/app/configuration/audit-log/audit-download-dialog.component.scss b/ui/src/app/configuration/audit-log/audit-download-dialog.component.scss
new file mode 100644
index 0000000000..97e3df97cd
--- /dev/null
+++ b/ui/src/app/configuration/audit-log/audit-download-dialog.component.scss
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+.audit-download-columns,
+.audit-download-ready {
+    display: flex;
+    flex-direction: column;
+    gap: var(--space-sm);
+    padding-block: var(--space-md);
+}
+
+.audit-download-ready mat-icon {
+    color: var(--color-primary);
+}
+
+.audit-download-error {
+    color: var(--color-error);
+}
diff --git a/ui/src/app/configuration/audit-log/audit-download-dialog.component.ts b/ui/src/app/configuration/audit-log/audit-download-dialog.component.ts
new file mode 100644
index 0000000000..f8cca08747
--- /dev/null
+++ b/ui/src/app/configuration/audit-log/audit-download-dialog.component.ts
@@ -0,0 +1,151 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+import { ChangeDetectionStrategy, Component, inject } from '@angular/core';
+import { FormsModule } from '@angular/forms';
+import { MatButtonModule } from '@angular/material/button';
+import { MatCheckboxModule } from '@angular/material/checkbox';
+import { MatDividerModule } from '@angular/material/divider';
+import { MatIconModule } from '@angular/material/icon';
+import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
+import { MatStep, MatStepLabel, MatStepper } from '@angular/material/stepper';
+import {
+    AuditEntry,
+    AuditQuery,
+    AuditService,
+} from '@streampipes/platform-services';
+import { DialogRef } from '@streampipes/shared-ui';
+import { TranslatePipe, TranslateService } from '@ngx-translate/core';
+import { expand, reduce } from 'rxjs';
+
+interface AuditExportColumn {
+    id: keyof AuditEntry;
+    label: string;
+    selected: boolean;
+}
+
+@Component({
+    selector: 'sp-audit-download-dialog',
+    templateUrl: './audit-download-dialog.component.html',
+    styleUrls: ['./audit-download-dialog.component.scss'],
+    changeDetection: ChangeDetectionStrategy.Eager,
+    imports: [
+        FormsModule,
+        MatButtonModule,
+        MatCheckboxModule,
+        MatDividerModule,
+        MatIconModule,
+        MatProgressSpinnerModule,
+        MatStepper,
+        MatStep,
+        MatStepLabel,
+        TranslatePipe,
+    ],
+})
+export class AuditDownloadDialogComponent {
+    private dialogRef =
+        inject<DialogRef<AuditDownloadDialogComponent>>(DialogRef);
+    private auditService = inject(AuditService);
+    private translate = inject(TranslateService);
+
+    query: AuditQuery;
+    downloading = false;
+    downloadFailed = false;
+    readonly columns: AuditExportColumn[] = [
+        { id: 'storedAt', label: 'Stored at', selected: true },
+        { id: 'eventType', label: 'Event type', selected: true },
+        { id: 'outcome', label: 'Outcome', selected: true },
+        { id: 'actor', label: 'Actor username', selected: true },
+        { id: 'resourceType', label: 'Resource type', selected: true },
+        { id: 'resourceId', label: 'Resource ID', selected: true },
+        { id: 'eventId', label: 'Event ID', selected: true },
+    ];
+
+    get hasSelectedColumns(): boolean {
+        return this.columns.some(column => column.selected);
+    }
+
+    close(): void {
+        this.dialogRef.close();
+    }
+
+    download(stepper: MatStepper): void {
+        if (this.downloading || !this.hasSelectedColumns) {
+            return;
+        }
+
+        this.downloading = true;
+        this.downloadFailed = false;
+        const query = { ...this.query, limit: 200, cursor: undefined };
+        this.auditService
+            .getEvents(query)
+            .pipe(
+                expand(page =>
+                    page.nextCursor
+                        ? this.auditService.getEvents({
+                              ...query,
+                              cursor: page.nextCursor,
+                          })
+                        : [],
+                ),
+                reduce(
+                    (entries: AuditEntry[], page) => entries.concat(page.items),
+                    [],
+                ),
+            )
+            .subscribe({
+                next: entries => {
+                    this.saveCsv(entries);
+                    this.downloading = false;
+                    stepper.next();
+                },
+                error: () => {
+                    this.downloading = false;
+                    this.downloadFailed = true;
+                },
+            });
+    }
+
+    private saveCsv(entries: AuditEntry[]): void {
+        const selectedColumns = this.columns.filter(column => column.selected);
+        const csv = [
+            selectedColumns
+                .map(column =>
+                    this.escape(this.translate.instant(column.label)),
+                )
+                .join(','),
+            ...entries.map(entry =>
+                selectedColumns
+                    .map(column => this.escape(entry[column.id]))
+                    .join(','),
+            ),
+        ].join('\r\n');
+        const link = document.createElement('a');
+        const url = URL.createObjectURL(
+            new Blob([csv], { type: 'text/csv;charset=utf-8' }),
+        );
+        link.href = url;
+        link.download = 'audit-log.csv';
+        link.click();
+        URL.revokeObjectURL(url);
+    }
+
+    private escape(value: string | null | undefined): string {
+        return '"' + (value ?? '').replaceAll('"', '""') + '"';
+    }
+}
diff --git a/ui/src/app/configuration/audit-log/audit-log.component.html b/ui/src/app/configuration/audit-log/audit-log.component.html
index 8dcd5b3eca..cc78bd8b95 100644
--- a/ui/src/app/configuration/audit-log/audit-log.component.html
+++ b/ui/src/app/configuration/audit-log/audit-log.component.html
@@ -20,6 +20,16 @@
     [title]="'Audit Log' | translate"
     [subtitle]="'Review who changed what in your platform.' | translate"
 >
+    <button
+        section-actions
+        mat-icon-button
+        [attr.aria-label]="'Download audit log' | translate"
+        [matTooltip]="'Download audit log' | translate"
+        (click)="openDownloadDialog()"
+        [disabled]="!status?.enabled"
+    >
+        <mat-icon>download</mat-icon>
+    </button>
     <button
         section-actions
         mat-icon-button
diff --git a/ui/src/app/configuration/audit-log/audit-log.component.spec.ts b/ui/src/app/configuration/audit-log/audit-log.component.spec.ts
index 42d5914a7c..23df71fa9f 100644
--- a/ui/src/app/configuration/audit-log/audit-log.component.spec.ts
+++ b/ui/src/app/configuration/audit-log/audit-log.component.spec.ts
@@ -18,6 +18,7 @@
 
 import { TranslateService } from '@ngx-translate/core';
 import { AuditDialogComponent } from './audit-dialog.component';
+import { AuditDownloadDialogComponent } from './audit-download-dialog.component';
 import { TestBed } from '@angular/core/testing';
 import {
     AuditService,
@@ -174,6 +175,22 @@ describe('AuditLogComponent', () => {
         );
     });
 
+    it('opens a download dialog with the active audit filters', () => {
+        component.ngOnInit();
+        component.openDownloadDialog();
+        expect(dialogs.open).toHaveBeenCalledWith(
+            AuditDownloadDialogComponent,
+            expect.objectContaining({
+                data: expect.objectContaining({
+                    query: expect.objectContaining({
+                        from: expect.any(String),
+                        to: expect.any(String),
+                    }),
+                }),
+            }),
+        );
+    });
+
     it('distinguishes storage failure from empty results and allows retry', () => {
         api.getEvents.mockReturnValueOnce(throwError(() => ({ status: 503 })));
         component.ngOnInit();
diff --git a/ui/src/app/configuration/audit-log/audit-log.component.ts b/ui/src/app/configuration/audit-log/audit-log.component.ts
index b4c90f64ba..0c4ddd536c 100644
--- a/ui/src/app/configuration/audit-log/audit-log.component.ts
+++ b/ui/src/app/configuration/audit-log/audit-log.component.ts
@@ -61,6 +61,7 @@ import {
 import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
 import { Subscription } from 'rxjs';
 import { AuditDialogComponent } from './audit-dialog.component';
+import { AuditDownloadDialogComponent } from './audit-download-dialog.component';
 import { SpConfigurationRoutes } from '../configuration.breadcrumb';
 
 import { auditOutcomeTone } from './audit-outcome';
@@ -325,6 +326,18 @@ export class AuditLogComponent implements OnInit {
         });
     }
 
+    openDownloadDialog(): void {
+        if (!this.query) {
+            return;
+        }
+        this.dialogs.open(AuditDownloadDialogComponent, {
+            panelType: PanelType.SLIDE_IN_PANEL,
+            title: this.translate.instant('Download audit log'),
+            width: '50vw',
+            data: { query: this.query },
+        });
+    }
+
     outcomeLabel(outcome: string): string {
         const labels: Record<string, string> = {
             succeeded: 'Succeeded',