Hello,
I have a PowerShell script that stores Windows Event Logs in the processed_logs.json
file. This script runs as a service and creates the processed_logs.json
file each time. The Alloy configuration is as follows:
loki.source.file "processed_logs" {
targets = [
{ __path__ = "C:\\scripts\\processed_logs.json" },
]
forward_to = [loki.write.default.receiver]
}
loki.write "default" {
endpoint {
url = "http://192.168.1.2:3100/loki/api/v1/push"
}
external_labels = {
job = "windows-security",
logsource = "windows-eventlog",
}
}
Because each time the file is created by the script, Alloy sends the whole file again, so duplicate reports are sent to the server. What solution do you suggest to solve this problem?
Thank you.