Page 1 of 1

Export to Google Spreadsheet and Google Drive

Posted: Mon Sep 09, 2019 12:58 pm
by nuchchie
Hello! I would like to export list of my active hotspot users to Google spreadsheet and Google Drive for every 1-hour with Winbox command but I could do only export to my email. Is there any way to do that?

So I put these in the scheduler and make it execute every 1-hour

Code: Select all

/////////////this command is to export list of active user to local file////////////////////
/ip hotspot active print file=active_user_list.txt

/////////////this command is to send that exported file to the email as extachment///////////////////
/tool e-mail send to="xxx@mail.com" subject="Active User $[/system clock get date] Report" \
body="$[/ip hotspot active print count-only] " file=active_user_list.txt

Re: Export to Google Spreadsheet and Google Drive

Posted: Mon Sep 09, 2019 8:15 pm
by Jotne
Not directly an answer to your question, but this how I would do it.

Schedule this script (not tested since I do not have hotspot)
:foreach logline in=[/ip hotspot active find] do={
	:local output "$[/ip hotspot active print as-value from=$logline]"
	:set ( "$output"->"script" ) "hotspot"
	:log info message="$output" 
}
Then use Splunk to get the syslog message and create a dashboard to monitor.

See my Splunk for MikroTik here:
viewtopic.php?f=23&t=137338