Community discussions

MikroTik App
 
omi
just joined
Topic Author
Posts: 15
Joined: Tue Jun 04, 2013 7:27 pm

Userman command to print user history FROM/TO

Thu Aug 25, 2016 10:11 pm

Hello,

I tried a couple of commands and tricks but cant seem to get the right one.

What I need to do here is to find the command, to see who accessed the system searching with a certain time frame. For example from jun/24/2016 to jun/30/2016

Just reminding when you do run simple command you get:

/tool user-manager session print
0 customer=admin user="hps" nas-port=2148532502 nas-port-type=wireless-802.11 nas-port-id="ether2" calling-station-id="30:75:12:FD:05:E9"
user-ip=10.5.49.22 host-ip=x.x.x..x status=start,stop,closed from-time=nov/30/2015 11:37:04 till-time=nov/30/2015 11:37:58
terminate-cause=admin-reset uptime=54s download=799262 upload=140593

1 customer=admin user="hps" nas-port=2148532505 nas-port-type=wireless-802.11 nas-port-id="ether2" calling-station-id="20:A2:E4:08:54:65"
user-ip=10.5.49.19 host-ip=x.x.x.x. status=start,stop,interim from-time=nov/30/2015 11:43:04 till-time=nov/30/2015 11:44:54
terminate-cause=admin-reset uptime=1m50s download=595741 upload=145733
...

I used the following command,to FILTER, but it is not what I need as the below command just 'greps' the word needed and doesnt show/search within time period

tool user-manager session print where from-time~"jun/24/2016"

Flags: A - active
0 customer=admin user="rsloouwer" nas-port=2149615696 nas-port-type=wireless-802.11 nas-port-id="ether2"
calling-station-id="B4:xx:7E:DF:xx:E9" user-ip=10.5.49.89 host-ip=x.x.x.x status=start,interim,closed
from-time=jun/24/2016 04:55:28 till-time=jun/28/2016 16:14:18 terminate-cause=local-admin-request uptime=4d11h18m50s download=12113147
upload=2253288

1 customer=admin user="cgorou" nas-port=2149615699 nas-port-type=wireless-802.11 nas-port-id="ether2"
calling-station-id="F8:4:F2:A6:xx:7E" user-ip=10.5.49.150 host-ip=x.x.x.x status=start,stop,interim,closed
from-time=jun/24/2016 04:59:31 till-time=jun/28/2016 07:06:46 terminate-cause=admin-reset uptime=4d2h7m16s download=313687624
upload=13172207

I also know that user manager can give this report see here:
from session to - usermanager report.png
but am not sure what is the command to get it! ????

Please advise - many thanks
You do not have the required permissions to view the files attached to this post.
 
omi
just joined
Topic Author
Posts: 15
Joined: Tue Jun 04, 2013 7:27 pm

Re: Userman command to print user history FROM/TO

Fri Aug 26, 2016 2:19 pm

Hello - anybody with experience on userman commands to help out ? Please :o :o
 
omi
just joined
Topic Author
Posts: 15
Joined: Tue Jun 04, 2013 7:27 pm

Re: Userman command to print user history FROM/TO

Wed Aug 31, 2016 6:02 pm

Have tried the following command in API but it gives error.

tool user-manager session print terse where from-time~"jun/24/2016" : returns error - incorrect syntax


If I try same command in CLI it gives data out.

Can someone help to give us the correct API command please??

Who is online

Users browsing this forum: No registered users and 9 guests