Forum

Results 1 to 5 of 5
  1. #1
    Join Date
    October 2018
    Location
    Germany
    Posts
    44

    Possible to determine who assigned group without reading through log?

    I am trying to determine which user gave a group to another user and I want this information to be displayed somewhere else.
    The whole process should be completely automatic, like a query running every 5 minutes or so.

    Therefor reading manually through the serverlog is not an option but maybe automatically scanning the logfile is.
    However I am uncertain if this would be the best (and only) way to achieve this so I am open for suggestions

  2. #2
    Join Date
    June 2011
    Location
    Germany
    Posts
    4,335
    There is no other option unless you are using the clientquery plugin which I'm sure will have an event for this which you could subscribe to and log.

  3. #3
    Join Date
    October 2018
    Location
    Germany
    Posts
    44
    Welp, that was what I expected but it's always better to ask beforehand

    Quote Originally Posted by numma_cway View Post
    the clientquery plugin which I'm sure will have an event for this which you could subscribe to and log.
    Thanks for the idea, will definitely check this one out.

  4. #4
    Join Date
    October 2018
    Location
    Germany
    Posts
    44
    Just a quick update if someone stumbles upon this question:

    I realized this via a Powershell-Script that extracts the ID of the receiving user and the ID of the User that gave the receiving user the group.

    It is not ideal because it reads through ALL logfiles when being executed and relies on the "notification" for the group not to be changed in a future update but I guess it is a solid base and maybe you can work out a more refined version with this script as a base

    Code:
    #config
    $outfilepath="<NAME AND PATH OF THE RESULTSFILE (CSV-FORMAT)"
    $logfilespath="<PATH TO THE TS3-SERVER'S /LOG-FOLDER"
    $groupid=<YOUR GROUP ID>
    $groupname="<NAME OF YOUR GROUP>"
    
    #remove the old outfile before exporting the new list
    Remove-Item $outfilepath
    
    #searchstring that is used to determine which lines correlate to the group being "awarded"
    $searchWords = "id:(\d+)\) was added to servergroup '"+$groupname+"'\(id:"+$groupid+"\) by client.+id:(\d+)\)"
    
    Foreach ($sw in $searchWords)
    {
    	Get-Childitem -Path $logfilespath -Recurse -include "*.log" | 
        Select-String -Pattern "$sw" | % {"$($_.matches.groups[1]),$($_.matches.groups[2])"} |
    	Out-File -Encoding "UTF8" -FilePath $outfilepath -Append
    }
    The results look like this:
    1234,4321
    4711,9941
    6521,9223
    etc.

    The first number is the TS-DBID of the user that received the group and the last number is the TS-DBID of the user that received the group.

    Feel free to use this script as you like.
    Just make sure to notify me of any changes you made to improve the script so I can update this answer and provide ppl with the latest version of it

  5. #5
    Join Date
    May 2007
    Location
    Eastern NC
    Posts
    1,794
    Quote Originally Posted by LKNickname View Post
    Just a quick update if someone stumbles upon this question:

    I realized this via a Powershell-Script that extracts the ID of the receiving user and the ID of the User that gave the receiving user the group.

    It is not ideal because it reads through ALL logfiles when being executed and relies on the "notification" for the group not to be changed in a future update but I guess it is a solid base and maybe you can work out a more refined version with this script as a base

    Code:
    #config
    $outfilepath="<NAME AND PATH OF THE RESULTSFILE (CSV-FORMAT)"
    $logfilespath="<PATH TO THE TS3-SERVER'S /LOG-FOLDER"
    $groupid=<YOUR GROUP ID>
    $groupname="<NAME OF YOUR GROUP>"
    
    #remove the old outfile before exporting the new list
    Remove-Item $outfilepath
    
    #searchstring that is used to determine which lines correlate to the group being "awarded"
    $searchWords = "id:(\d+)\) was added to servergroup '"+$groupname+"'\(id:"+$groupid+"\) by client.+id:(\d+)\)"
    
    Foreach ($sw in $searchWords)
    {
    	Get-Childitem -Path $logfilespath -Recurse -include "*.log" | 
        Select-String -Pattern "$sw" | % {"$($_.matches.groups[1]),$($_.matches.groups[2])"} |
    	Out-File -Encoding "UTF8" -FilePath $outfilepath -Append
    }
    The results look like this:
    1234,4321
    4711,9941
    6521,9223
    etc.

    The first number is the TS-DBID of the user that received the group and the last number is the TS-DBID of the user that received the group.

    Feel free to use this script as you like.
    Just make sure to notify me of any changes you made to improve the script so I can update this answer and provide ppl with the latest version of it
    If the bold part is true both numbers should be the same. I'm guessing one of those "received" should have been "gave" or "assigned".

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Server Group that overrides all other assigned groups.
    By BoKa1337 in forum Permission System
    Replies: 2
    Last Post: February 26th, 2015, 03:10 PM
  2. Keep somone from getting assigned a group?
    By BobBart in forum Permission System
    Replies: 7
    Last Post: December 10th, 2013, 09:28 AM
  3. Replies: 1
    Last Post: March 24th, 2013, 02:28 PM
  4. Group to only be assigned to oneself
    By marvin in forum Permission System
    Replies: 2
    Last Post: February 6th, 2013, 07:31 PM
  5. [No Bug] Usser assigned himself a server group
    By BogusBoo in forum Permission System
    Replies: 6
    Last Post: March 25th, 2011, 04:14 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •