15 December 2023

10 August 2016

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.

CommandRequired ParametersRequired Corrade PermissionsExample
logsgroup, password, entity, actiontalk
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.

ParameterPossible ValueSecond ParameterPossible ValueOther ParametersDescription
entitygroupactiongetfromRetrieve the group chat logs.
to
firstname
lastname
message
searchdataSearch the group chat logs using a regular expression.
localactiongetfromRetrieve local chat logs.
to
firstname
lastname
message
region
type
searchdataSearch the local chat logs using a regular expression.
regionactiongetfromRetrieve region chat logs.
to
firstname
lastname
message
region
searchdataSearch the region chat logs using a regular expression.
messageactiongetfromRetrieve instant message chat logs.
to
firstname
lastname
message
searchdataSearch the instant message chat logs using a regular expression.
conferenceactiongetfromRetrieve conference message chat logs.
to
firstname
lastname
message
searchdataSearch 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"
        ]
    )
);