File: diff-remove-timestamps

package info (click to toggle)
bro-aux 0.42-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, sid, trixie
  • size: 1,104 kB
  • sloc: sh: 999; ansic: 943; ruby: 71; makefile: 68; perl: 35; cpp: 26
file content (13 lines) | stat: -rwxr-xr-x 383 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
#! /usr/bin/env bash
#
# Replace anything which looks like timestamps with XXXs (including the #start/end markers in logs).

# Get us "modern" regexps with sed.
if [ `uname` == "Linux" ]; then
   sed="sed -r"
else
   sed="sed -E"
fi

$sed 's/(0\.000000)|([0-9]{9,10}\.[0-9]{2,8})/XXXXXXXXXX.XXXXXX/g' | \
$sed 's/^ *#(open|close).(19|20)..-..-..-..-..-..$/#\1 XXXX-XX-XX-XX-XX-XX/g'