for now I want to see all the login attempts made to my router
I can see in the “MikroTik Admin user login” all the login (good and bad)
so I guess this working , now? right
I have also added the script - but I can’t see any data on router voltage\temp
the script in running without any problems - so why I don’t see in the the Splunk?
I can’t see any other data also in no page - everything is No results found. (even on router uptime, temp\voltage )
why is it?
the accounting is working
/ip accounting
set enabled=yes threshold=2560
do I need to enable something in the firewall so the server can read this data or something ?
**also why do I need to enable the accounting? , the data is send out from the router and not from the Splunk to the router - or I missunderstand soemthing?
Thanks ,
This gets all dhcp logs including debug dhcp packets.
This gets all hotspot logs including debug hotspot packets.
With the !, get all other logs that are not debug, packet and snmp.
Voltage and temperature are only on devices that do supports it.
Accounting is used to get all the packet flow from the router to Splunk.
Accounting is gone in v7, so there netflow has to be used. Not implemented in my solution, yet.
OK
I just saw you answer
I thought that on the RBM33G there is temp\voltage , but now I see there isn’t any
:put [/system health get cpu-temperature ]
I can see the device now , I looked somewhere else
so if I want to see only spesific things I can only make logs for them ?
is there any where a WiKi or some explain about what each page can show and how he read it ?
for example -
this is what I get in the Device list
when I put a wrong password I can see in the router logs “error login failure for user admin from 8.19.166.6 via winbox”
and on the splunk page I can see the line:
_time host user system user_ip eventtype host_name
2021-06-20 12:56:50 9.13.10.118 admin winbox 8.19.166.6 adm_user_login_failure 9.13.10.118
2 questions (help)
why I can’t see the name I setup in the identity for this router in the host name \ host user system?
is there any way to make the login send more information ? for example the MAC of the ethernet and put it in the host name?
I’m asing because my devices use dynamic IP - so the router IP give me nothing.
Everything is already logged in menu Overview → MikroTik Admin user login.
There you see both logged inn and blocked user.
You have changed from the default log action setup and do loose a lot of information since you do only log some.
Change back to what is posted inn first post and you get all back.
1st up, amazing effort, love this, so easy to setup and use, thank you.
I have a question though …
A lot of my nodes are LTE based devices, so they tend to change IP address quite frequently and as a result of that if i want to look at traffic utlisiation for the device, i need to collate all the stats from the various IPs.
Is there any way to aggregate the data at hostname level opposed to IP ?
Use different number or name for the sys to distinguish each ruter.
Take care not use to long ID, since it eats of the max packet size.
Then you need to adapt the Splunk app to use sys instead of host
Its some work to do, but it will give you separate logs for each router based by the sys name.
another question
I notice that my all my device are sending data to another syslog system
so I have connected to the log file of it and sendting the data to the Splunk
it’s working - I get the data - but not as mikrotik (just as regular udp syslog )
is there anything I can change in the setting of the Splunk-Mikrotik to read that data?
this is what I’m getting on the splunk :
SEVERE 05/07 06:24:06 wrong message: 3.13.12.118 <27>Jul 5 09:24:06 Router script error: error - contact MikroTik support and send a supout file (2)
can I change the reading somehow so it will enter the splunk as Mikrotik ?
If I understand you, you do not get the “MikroTik” prefix?
system,info,account > MikroTik> : sys=22: user hidden logged out from 1.2.3.4 via winbox
The whole app with field extraction etc are based on this tag, so If that changes or are removed, lots of the stuff inn the app must be rewritten.
Possible, but you need to try to figure it out.
Thank you so much Jotne this is an amazing tool you put together!
I am new to Mikrotik, just got the router 2 weeks ago.
I am wondering how you guys get the hostname to show in the screenshots? I have the IP address instead?
My Splunk host (=VM) just resolves these.
If you have a rather “static” small home-network, just add them to /etc/hosts or something on the Splunk host so your internal entries are resolved too.
If you run a Pihole or other DNS internal just let Splunk use that one and add the entries over there.
Ah ok, you run Splunk in a container.
DNS resolving in a container is slightly different so I read. Perhaps you could try info below ?
On linux systems, DNS resolution happens using /etc/resolv.conf file, check this file inside your container, if it has invalid DNS, then your container won’t be able to resolve hostnames.
Docker uses a property set in /etc/docker/daemon.json file(on host) for populating entries in /etc/resolv.conf inside container.
update the value of this property in /etc/docker/daemon.json file in host machine:
{
“dns”: [“8.8.8.8”]
}
Note: This change requires restarting docker to take effect, also existing containers have to be removed and created again.
oh I should have mentioned that the command line output I shared were directly from the docker host that runs the docker container. The DNS issues materialize on the physical machine and for some reasons name resolution only happen with the .local domain.
Anyway - I did not figure it out yet, but I am happy with the /etc/hosts solution. I actually find it better than DNS resolution because I can give more friendly name to my devices.
For those who are contemplating running splunk in docker, here is my script:
New file found under section 1g) at the first post
This version contains lots of tweaks and fixes, and some new KV store
To upgrade, delete the folder /splunk/etc/app/Mikrotik
Then install the unpacked spl (use winrar/winzip) file, install app from
"Manage app" -> "Install app from file"
To get the most out of this version, upgrade the script (not needed) on the router to latest version. (3.9+)
3.3 (13.08.2021)
New KV store (used to store info about Devices and DHCP info
Changed from table to fields in base search for all dashboard to speed up searches.
Added more DNS extraction
Updated script to 4.4 (Added firmware info)
Added frimware info "MikroTik Device List"
Fixed lookup "MikroTik Wifi strength"
Added new DoH dashboard "MikroTik DoH information"
Change table format "MikroTik Interface Changes"
Fixed typo in eventtype "MikroTik VPN Connections"
Added user local ip "MikroTik VPN Connections"
Fixed missing search in 2b, duplicate entry in user-name, added 1b login info "MikroTik VPN Connections"
Fixed to not show false logged in user "MikroTik VPN Connections"
Fixed html formatting in "Mikrotik DHCP to Static"
Thanks for the update Jotne. I seems I've lost data on the "Overview" > "Device List" is not populating (as in "no result found")
All other tabs seems to work find, data is still coming in normally.
I'm running it on a RB3011 / 6.47.x release
If I look in the output on the console while the script is running, I'm only seeing this line : " script=version ver=4.4" where I normally would need to see more like
:local model
:local serial
if ($SystemInformation and $run) do={
:local version ([/system resource get version])
:local board ([/system resource get board-name])
:do {
:set model ([/system routerboard get model])
:set serial ([/system routerboard get serial-number])
} on-error={
:set model na
:set serial na
}
:local identity ([/system identity get name])
:log info message="script=sysinfo version="$version" board-name="$board" model="$model" serial=$serial identity="$identity""
}
While you new script has this one
\
Collect system information
----------------------------------
:local model na
:local serial na
:local ffirmware na
:local cfirmware na
:local ufirmware na
:if ($SystemInformation and $run) do={
:local version ([/system resource get version])
:local board ([/system resource get board-name])
:if ([/system routerboard get routerboard]) do={
/system routerboard
:set model ([get model])
:set serial ([get serial-number])
:set ffirmware ([get factory-firmware])
:set cfirmware ([get current-firmware])
:set ufirmware ([get upgrade-firmware])
}
:local identity ([/system identity get name])
:log info message="script=sysinfo version="$version" board-name="$board" model="$model" serial=$serial identity="$identity" factory-firmware="$ffirmware" current-firmware="$cfirmware" upgrade-firmware="$ufirmware""
}