Can we pull user profile or username from UUID present in the log files?

Can we pull user profile or username from UUID present in the log files?

OriginalPostID-203272

OriginalPostID-203272

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    I'm assuming you already have the user UUID pulled from the log file that you want to find; I don't know if there's an in-system way to do this in particular. However I previously wrote the following functionality which finds the user belonging to the UUID you're looking for, here referred to as ri!findUUID:


    with(
      local!allUsers: getdistinctusers(cons!GROUP_CONTAINING_ALL_USERS),
    
      local!allUUIDs: apply(
        fn!user(
          _,
          "uuid"
        ),
        local!allUsers
      ),
    
      local!lookupTable: joinarray(
        apply(
          fn!concat,
          merge(
            local!allUsers,
            repeat(length(local!allUsers), " - "),
            local!allUUIDs
          )
        ),
        char(10)
      ),
    
    
      local!foundUser: index(local!allUsers, wherecontains(ri!findUUID, local!allUUIDs)),
    
      "Found: " & local!foundUser & char(10)&char(10) & "List:" & char(10) & local!lookupTable
    )

    (EDIT: note that this trick should no longer be needed in at least the recent few versions, please see my newest response further down-thread from here).

Reply
  • 0
    Certified Lead Developer

    I'm assuming you already have the user UUID pulled from the log file that you want to find; I don't know if there's an in-system way to do this in particular. However I previously wrote the following functionality which finds the user belonging to the UUID you're looking for, here referred to as ri!findUUID:


    with(
      local!allUsers: getdistinctusers(cons!GROUP_CONTAINING_ALL_USERS),
    
      local!allUUIDs: apply(
        fn!user(
          _,
          "uuid"
        ),
        local!allUsers
      ),
    
      local!lookupTable: joinarray(
        apply(
          fn!concat,
          merge(
            local!allUsers,
            repeat(length(local!allUsers), " - "),
            local!allUUIDs
          )
        ),
        char(10)
      ),
    
    
      local!foundUser: index(local!allUsers, wherecontains(ri!findUUID, local!allUUIDs)),
    
      "Found: " & local!foundUser & char(10)&char(10) & "List:" & char(10) & local!lookupTable
    )

    (EDIT: note that this trick should no longer be needed in at least the recent few versions, please see my newest response further down-thread from here).

Children
No Data