Fortsatte roadmapen med multi-entity stream profiles

This commit is contained in:
larssand
2026-06-29 19:08:23 +02:00
parent 20b0e0a92e
commit 68370217da
10 changed files with 102 additions and 60 deletions

View File

@@ -42,6 +42,16 @@ def profile_entity(event: LogEvent, field: str) -> str:
return str(event.fields.get(field.lower(), "")).strip()
def profile_entities(event: LogEvent, profile: object) -> tuple[str, ...]:
fields = tuple(str(field) for field in getattr(profile, "entity_fields", ()) if field) or (str(getattr(profile, "entity_field", "")),)
values = []
for field in fields:
value = profile_entity(event, field)
if value and value not in values:
values.append(value)
return tuple(values)
def sample_timeline(events: Iterable[LogEvent], *, limit: int = 20) -> list[dict[str, str]]:
samples = [
{