Hi, I want to do masking for logs at index time but the replaced value ("X" here) should be same character length as original string. My requirement for masking is that for the value within [] only last 4 characters should be visible. Example for below logs: 2020-08-18T13:17:43,990 [Engine 1] TRACE log data V01 [1|12345678] 2020-08-18T13:17:44,979 [Engine 2] TRACE log data V02 [2|A35453DFDF65] The indexed logs should be: 2020-08-18T13:17:43,990 [Engine 1] TRACE log data V01 [1|XXXX5678] 2020-08-18T13:17:44,979 [Engine 2] TRACE log data V02 [2|XXXXXXXXDF65] Currently I am using SEDCMD command as below but that is taking only static length for X: s/(TRACE\slog\s+data\s+V\d+\s+\[\d\|)(\w+)(\w{4})/\1XXXXXX\3/g Is there a way to replace string at index time with another string maintaining the count of characters.
... View more