New answers tagged

0

Log files can use a time format such as ISO 8601 or its cousin RFC 3339 that shows local time as an adjustment of UTC. If the time entries end with Z or if it ends in a hyphen (8601), minus or plus followed by an offset value then it's using a format based on UTC. When the log is based on UTC then daylight shows up as a change in the offset. The offset ...


2

Logfiles do not "handle" time zones, they just record what some application or service wrote there. So if an application writes "just the messages" and "directly to the log file", you're out of luck. Some syslog servers (like syslog-ng) allow you to "decorate" the "raw" log data by time stamps, where you can choose to use UTC or local time with or without ...


5

Logfiles are plain text files, and each line is appended at the end. So there is no loss of data when using non-UTC timezone. Of course, you may view the files using a tool which can get confused. However, the usual reason for using UTC is to avoid ambiguity: you do not have to know what the local timezone is to interpret the data. So yes, using UTC in ...


5

The POSIX module includes the strftime function, which allows via strftime(3) conversion specifier characters the desired templating of time: % perl -MPOSIX=strftime -E 'say strftime "[%F %T]", localtime(time)' [2011-02-17 10:55:37] % So in your case make it perl -MPOSIX=strftime -e ... and then printf( ($line=~/^\[\s*(\d+)\.\d+\](.+)/) ? ( "[%s]%s\n", ...


1

You cant see when the file was created due to most filesystems does not save creation date (ext3 ext4). You can use find location -ctime time_period eg: With -15 as time period you will see the files modified less than 15 days ago. +15 files modified more than 15 days ago, and just 15 files modified exactly 15 days ago. -c flag shows when last ...


0

It sounds like csh on your system is really tcsh and it's reading your config when you don't intend it to. Either that or you've configured a history file for both tcsh and csh. If csh is tcsh, you could invoke csh with csh -f to skip reading your .tcshrc file. I'm not sure you can configure it to read an arbitrary file before starting, but it's simple ...


0

Here is a ready solution: Download the speedtest-csv script and Give it execute permission: wget -O speedtest-csv https://raw.githubusercontent.com/HenrikBengtsson/speedtest-cli-extras/master/bin/speedtest-csv chmod +x speedtest-csv Next move speedtest-csv to /usr/bin/ mv speedtest-csv /usr/bin/ Generate CSV header speedtest-csv --header >> /...


1

awk -v date="$(date +%d-%m-%Y\ %H:%M)" -v OFS=';' '/Download:/ { d=$2; } /Upload:/ { print date, d, $2, ""; d="" }' speedtest


0

I have found the solution: perl -MPOSIX -le 'print strftime ""%Y%m%d%H%M%S", localtime((lstat)[9]) for @ARGV' file.txt



Top 50 recent answers are included