Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 32 additions & 6 deletions src/log2timeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import subprocess
import time
from uuid import uuid4
import os

from openrelik_worker_common.file_utils import create_output_file
from openrelik_worker_common.task_utils import (
Expand Down Expand Up @@ -81,6 +82,13 @@
"type": "textarea",
"required": False,
},
{
"name": "output_file_name",
"label": "Output file name",
"description": "Custom name for the output Plaso file (without .plaso extension).",
"type": "text",
"required": False,
},
],
}

Expand Down Expand Up @@ -110,18 +118,36 @@ def log2timeline(
output_files = []
temp_dir = None

# Determine display file name from task_config if provided
custom_name = None
if task_config and task_config.get("output_file_name"):
custom_name = task_config["output_file_name"]
if not custom_name.lower().endswith(".plaso"):
custom_name = f"{custom_name}.plaso"

if len(input_files) == 1:
display_name=f"{input_files[0].get('display_name')}.plaso"
if custom_name:
display_name = custom_name
output_file = create_output_file(
output_path,
display_name=f"{input_files[0].get('display_name')}.plaso",
display_name=display_name,
data_type="plaso:log2timeline:plaso_storage",
)
else:
output_file = create_output_file(
output_path,
extension="plaso",
data_type="plaso:log2timeline:plaso_storage",
)
if custom_name:
display_name = custom_name
output_file = create_output_file(
output_path,
display_name=display_name,
data_type="plaso:log2timeline:plaso_storage",
)
else:
output_file = create_output_file(
output_path,
extension="plaso",
data_type="plaso:log2timeline:plaso_storage",
)
status_file = create_output_file(output_path, extension="status")

command = [
Expand Down