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 bca4584
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
1 change: 1 addition & 0 deletions esp/scm/ws_logaccess.ecm
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ ESPStruct LogColumn
ESParray<string> EnumeratedValues;
LogSelectColumnMode ColumnMode;
ESPenum LogColumnValueType ColumnType;
string Alias;
};

ESPResponse GetLogAccessInfoResponse
Expand Down
17 changes: 17 additions & 0 deletions esp/services/ws_logaccess/WsLogAccessService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,23 @@ bool Cws_logaccessEx::onGetLogAccessInfo(IEspContext &context, IEspGetLogAccessI
WARNLOG("Invalid col type found in logaccess logmap config");
}
}
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 bca4584

Please sign in to comment.