Skip to content

Commit

Permalink
HPCC-30571 LogAccess to report log column alias
Browse files Browse the repository at this point in the history
- Introduces logaccess column alias concept
- Adds WsLogAccess.getinfo Alias column
- Populates Alias column if reported in configuration
- Annotates ALA v1 instance with hpcc_log_component name
- Adds alias to helm schema
Signed-off-by: Rodrigo Pastrana <[email protected]>
  • Loading branch information
rpastrana committed Oct 19, 2023
1 parent 9cab6fd commit 33e0b82
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 4 deletions.
5 changes: 3 additions & 2 deletions esp/scm/ws_logaccess.ecm
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,14 @@ ESPenum LogColumnValueType : string
enum("enum")
};

ESPStruct LogColumn
ESPStruct [nil_remove] LogColumn
{
string Name;
ESPenum LogColumnType LogType;
ESParray<string> EnumeratedValues;
LogSelectColumnMode ColumnMode;
ESPenum LogColumnValueType ColumnType;
[min_ver("1.06")] string Alias;
};

ESPResponse GetLogAccessInfoResponse
Expand Down Expand Up @@ -219,7 +220,7 @@ ESPResponse GetLogsResponse
[min_ver("1.02")] unsigned int TotalLogLinesAvailable;
};

ESPservice [auth_feature("WsLogAccess:READ"), version("1.05"), default_client_version("1.05"), exceptions_inline("xslt/exceptions.xslt")] ws_logaccess
ESPservice [auth_feature("WsLogAccess:READ"), version("1.06"), default_client_version("1.06"), exceptions_inline("xslt/exceptions.xslt")] ws_logaccess
{
ESPmethod GetLogAccessInfo(GetLogAccessInfoRequest, GetLogAccessInfoResponse);
ESPmethod GetLogs(GetLogsRequest, GetLogsResponse);
Expand Down
20 changes: 20 additions & 0 deletions esp/services/ws_logaccess/WsLogAccessService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,26 @@ bool Cws_logaccessEx::onGetLogAccessInfo(IEspContext &context, IEspGetLogAccessI
WARNLOG("Invalid col type found in logaccess logmap config");
}
}
if (clientVer >= 1.06)
{
if (column.hasProp("@alias"))
{
try
{
espLogColumn->setAlias(column.queryProp("@alias"));
}
catch (IException *e)
{
VStringBuffer msg("Invalid alias found in logaccess logmap config for '%s'", csearchColumn);
EXCLOG(e, msg.str());
e->Release();
}
catch(...)
{
WARNLOG("Invalid alias found in logaccess logmap config");
}
}
}
logColumns.append(*espLogColumn.getClear());
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ global:
- type: "instance"
storeName: "ContainerInventory"
searchColumn: "Name"
projectName: "hpcc_log_component"
alias: "hpcc_log_component"
columnMode: "ALL"
columnType: "string"
- type: "node"
Expand Down
2 changes: 1 addition & 1 deletion helm/hpcc/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3003,7 +3003,7 @@
"type": {
"type": "string",
"description" : "The searchable HPCC log column to be mapped - 'global' applies to all known fields",
"enum": [ "global", "workunits", "components", "audience", "class", "instance", "host", "node", "message", "logid", "processid", "threadid", "timestamp"]
"enum": [ "global", "workunits", "components", "audience", "class", "instance", "host", "node", "message", "logid", "processid", "threadid", "timestamp", "alias"]
},
"timeStampColumn": {
"description" : "Name of timestamp column related to mapped field (only requried for 'global' mapping)",
Expand Down

0 comments on commit 33e0b82

Please sign in to comment.