Hello
i have question about event logs
- How to export Event log to csv or text file
- Router support sent event log to FTP Server or sent a log via http or mqtt?
Hello
i have question about event logs
api get /events_log/config
)Hello,
Hello! I can help you with that. Here are the steps to export event logs to a CSV or text file, and how to send event logs from a router to an FTP server or via HTTP/MQTT.
Export Event Logs to CSV or Text File
Using PowerShell (Windows)
You can use PowerShell to export event logs to a CSV or text file. Here’s an example:
Export to CSV:
powershell
Get-EventLog -LogName Application | Export-Csv -Path “C:\temp\appLogs.csv” -NoTypeInformation
Export to Text:
powershell
Get-EventLog -LogName Application | Format-Table -AutoSize | Out-File “C:\temp\appLogs.txt”
Sending Event Logs to an FTP Server
Example for Huawei Routers
Enable the Information Center:
shell
system-view
sysname RouterA
info-center enable
Configure a Channel and Rule for Outputting Logs:
shell
info-center logfile channel channel6
info-center source ip channel channel6 log level warning
Transfer Log File to FTP Server:
shell
ftp 10.1.1.1
put flash:/logfile/log.log
quit
Sending Event Logs via HTTP or MQTT
Using MQTT (Milesight Router Example)
Connect Router to MQTT Broker:
Go to Service > MQTT page to add an SSM Smart Square Com MQTT connection.
Fill in the MQTT broker information and save.
Publish Data:
shell
/iot mqtt brokers add address=broker_address client-id=unique_id
/iot mqtt publish broker=broker_name topic=log_topic message="log_messag
Best Regard,
Nathan
Thank you for information