Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • 2
    If you ran that outside of awk/system, e.g. date -d today +%d/%m/%Y %H:%M, you'd get the same error so debug calling date on it's own first and then call it the same way from inside awk. If you need quotes on the command line (you do) then you need quotes inside the string you're passing to awk/system. Commented Jul 19, 2024 at 9:32
  • 1
    Calling an external command from awk will be very slow - you might want to consider not doing that. In particular GNU awk has it's own time functions so you may not need to call date from awk at all. Commented Jul 19, 2024 at 9:42
  • Depending on your OS and the original timestamp format, you might be able to use ts (from moreutils) to reformat the timestamps e.g. ts -r '%d/%m/%Y %H:%M' < file.log Commented Jul 19, 2024 at 22:11