Retrieve Chat Logs

15 December 2023

  • C12 - added the regular expression option.

10 August 2016

  • Release 9.111 - the entity parameter now also accepts conference in order to be able to process conference logs.
logs (Commands)
TypeCorrade progressive command
Commandlogs
Parametersentity, action
DescriptionThe logs command can be used to retrieve and search chat logs for: group messages, local messages, region messages, instant messages and conference messages.
Permissionstalk
Last ChangesRelease 9.111 - the entity parameter now also accepts conference in order to be able to process conference logs.

The logs command can be used to retrieve and search chat logs for: group messages, local messages, region messages, instant messages and conference messages. This command relies on the necessary settings that make Corrade log group, local, region and instant messages. The way the command works, is that it interprets the chat logs - usually found under various folders under the logs/ directory, compiles a search criteria based on user-supplied input and then performs the search. The result is a CSV list of data depending on the log type.

Command Required Parameters Required Corrade Permissions Example
logs group, password, entity, action talk
llInstantMessage(CORRADE,
    wasKeyValueEncode(
        [
            // retrieve all the local chat messages
            // for the region Punk's Emporium
            "command", "logs",
            "group", wasURLEscape(GROUP),
            "password", wasURLEscape(PASSWORD),
            "entity", "local",
            "region", "Punk's Emporium",
            "action", "get"
        ]
    )
);

When the action is set to get all the parameters such as from, to, etc… Are optional. That means that supplying extra parameters to the command will only strengthen the search criteria and narrow down the search. All the parameters except from and to - which represent dates, are interpreted as regular expressions.

Parameter Possible Value Second Parameter Possible Value Other Parameters Description
entity group action get from Retrieve the group chat logs.
to
firstname
lastname
message
search data Search the group chat logs using a regular expression.
local action get from Retrieve local chat logs.
to
firstname
lastname
message
region
type
search data Search the local chat logs using a regular expression.
region action get from Retrieve region chat logs.
to
firstname
lastname
message
region
search data Search the region chat logs using a regular expression.
message action get from Retrieve instant message chat logs.
to
firstname
lastname
message
search data Search the instant message chat logs using a regular expression.
conference action get from Retrieve conference message chat logs.
to
firstname
lastname
message
search data Search the conference message chat logs using a regular expression and regular expression options.
options

For example, suppose that we would want to search all the local chat logs for avatars whose first names are Moon, we would then issue the command:

llInstantMessage(CORRADE,
    wasKeyValueEncode(
        [
            // retrieve all the local chat messages
            // where the first name of the avatar
            // speaking the message on local chat
            // has the first name "Moon"
            "command", "logs",
            "group", wasURLEscape(GROUP),
            "password", wasURLEscape(PASSWORD),
            "entity", "local",
            "action", "get",
            "firstname", "Moon"
        ]
    )
);

Now, suppose we want to strengthen the retrieval by specifying that we want to retrieve the local messages for the avatar whose first name is Moon for the region Osprey Witherstone. In order to do that, we supply both the first name and the region parameter set to the region name Osprey Witherstone:

llInstantMessage(CORRADE,
    wasKeyValueEncode(
        [
            // retrieve all the local chat messages
            // for the region named Osprey Witherstone
            // where the first name of the avatar
            // speaking the message on local chat
            // has the first name "Moon"
            "command", "logs",
            "group", wasURLEscape(GROUP),
            "password", wasURLEscape(PASSWORD),
            "entity", "local",
            "action", "get",
            "firstname", "Moon",
            "region", "Osprey Witherstone"
        ]
    )
);

Next, we change our minds, and we want to perform the same search but we now search for the avatar whose first name is Moon but also Butch. In order to do that, we pass a regular expression to the firstname parameter:

llInstantMessage(CORRADE,
    wasKeyValueEncode(
        [
            // retrieve all the local chat messages
            // for the region named Osprey Witherstone
            // where the first name of the avatar
            // speaking the message on local chat
            // has the first name "Moon" or "Butch"
            "command", "logs",
            "group", wasURLEscape(GROUP),
            "password", wasURLEscape(PASSWORD),
            "entity", "local",
            "action", "get",
            "firstname", "Moon|Butch",
            "region", "Osprey Witherstone"
        ]
    )
);

secondlife/scripted_agents/corrade/api/commands/logs.txt · Last modified: 2023/12/16 18:29 by office

Access website using Tor Access website using i2p Wizardry and Steamworks PGP Key


For the contact, copyright, license, warranty and privacy terms for the usage of this website please see the contact, license, privacy, copyright.