I'm need create a script replace datetime to unixtime on error_log apache files
error_log:
[Mon Nov 01 21:48:54 2021] [:error] AH00898: Error reading from remote server returned by xxxxxxxxxx, referer
I need change it to:
[1635803334] [:error] AH00898: Error reading from remote server returned by xxxxxxxxxx, referer
I've a script which change unixtime to datetime with perl (I use it with squid log), any change to inverse logic here?
#! /usr/bin/perl -p
s/^\d+.\d+/localtime $&/e;
This script change timestamp ONLY and preserves anything else on stdout/file, I need something like this.
0 Answers