Re: [Json] JSON Log file encoding JSON-L

Nico Williams <nico@cryptonector.com> Wed, 07 May 2014 21:40 UTC

Return-Path: <nico@cryptonector.com>
X-Original-To: json@ietfa.amsl.com
Delivered-To: json@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 821471A03B5 for <json@ietfa.amsl.com>; Wed, 7 May 2014 14:40:18 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.044
X-Spam-Level:
X-Spam-Status: No, score=-1.044 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FM_FORGED_GMAIL=0.622, IP_NOT_FRIENDLY=0.334] autolearn=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gDU7_2zJav9I for <json@ietfa.amsl.com>; Wed, 7 May 2014 14:40:17 -0700 (PDT)
Received: from homiemail-a70.g.dreamhost.com (sub4.mail.dreamhost.com [69.163.253.135]) by ietfa.amsl.com (Postfix) with ESMTP id CC89F1A03AE for <json@ietf.org>; Wed, 7 May 2014 14:40:17 -0700 (PDT)
Received: from homiemail-a70.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a70.g.dreamhost.com (Postfix) with ESMTP id 8314A768061 for <json@ietf.org>; Wed, 7 May 2014 14:40:13 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=cryptonector.com; h= mime-version:in-reply-to:references:date:message-id:subject:from :to:cc:content-type; s=cryptonector.com; bh=hyF4BnH8pduydNqetQsi J5o2u9Y=; b=SiIuP3rcg1kQJnO65X0kj7TdBqe3ZcZmdvzuQUq0ikryFRXaQjd6 JAp0SEiq9t9OQpNwM+0RhlMWLr3gN79wEntEodoMM4BcBILJq+EP1opGw2iKl7hy h9FpkC13OceFTsya0QRhwRBgWKdEmOpg7G6KgmMHeknMTv9lI7QYhig=
Received: from mail-we0-f175.google.com (mail-we0-f175.google.com [74.125.82.175]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: nico@cryptonector.com) by homiemail-a70.g.dreamhost.com (Postfix) with ESMTPSA id 36D8876805C for <json@ietf.org>; Wed, 7 May 2014 14:40:13 -0700 (PDT)
Received: by mail-we0-f175.google.com with SMTP id t61so1652809wes.34 for <json@ietf.org>; Wed, 07 May 2014 14:40:12 -0700 (PDT)
MIME-Version: 1.0
X-Received: by 10.194.242.4 with SMTP id wm4mr84811wjc.88.1399498812022; Wed, 07 May 2014 14:40:12 -0700 (PDT)
Received: by 10.216.29.200 with HTTP; Wed, 7 May 2014 14:40:11 -0700 (PDT)
In-Reply-To: <CAMm+Lwh2kg21-_HVQxE_PyAmuzD_eHq4F56GS3B5OmG0J__1YQ@mail.gmail.com>
References: <CAMm+LwjB-51z4GoeC0riehmJg1HAddmLAyfMsVOCVM80i=RiMA@mail.gmail.com> <B9D8B85D-EF2C-4B3A-90A4-873C714C06FA@tzi.org> <CAK3OfOhGpUatFotCPwpHw=wu4zphxWOAk6dvX2UOZJRzw23JEA@mail.gmail.com> <CAK3OfOh1R851pBETEJtzM7_rCvrhxedCn5v5==nHumstE9VSRA@mail.gmail.com> <CAMm+LwiyJmk+3m25x28ZWhuCi84uW4O1iHn-N2CmXt_VzcDw9w@mail.gmail.com> <20140507011853.GA5011@mercury.ccil.org> <CAMm+Lwg-t3nc5-nk3JHV5RjKRQ+M9g8jY=VCKDAQU2G+Z1Mcdg@mail.gmail.com> <CAO1wJ5RgAdDs2_HCsTV2TarOJzB460FDmMbiE7q-r7bvWHT37A@mail.gmail.com> <CAK3OfOhG_jV++07iLF1ga6tJCKYiEeW_4=U7=HLR8Aq-KYPV3g@mail.gmail.com> <CAMm+LwgyXdSvmSx13boRZJJycQUO4Vsv=zTrHGrL_q0=2PM3hg@mail.gmail.com> <CAK3OfOj=im4G8N0SkSB1SEFoFxfe2Auw05BWcsKNXZSdJ5X9cw@mail.gmail.com> <CAMm+Lwh2kg21-_HVQxE_PyAmuzD_eHq4F56GS3B5OmG0J__1YQ@mail.gmail.com>
Date: Wed, 07 May 2014 16:40:11 -0500
Message-ID: <CAK3OfOhbGjdb2_fcXTrjeArS=60KjkXZZp-vjRjhBHSDfMBVQA@mail.gmail.com>
From: Nico Williams <nico@cryptonector.com>
To: Phillip Hallam-Baker <hallam@gmail.com>
Content-Type: text/plain; charset="UTF-8"
Archived-At: http://mailarchive.ietf.org/arch/msg/json/WoeyPUzas4WIm9nmFzxP9MhI5LU
Cc: John Cowan <cowan@mercury.ccil.org>, Carsten Bormann <cabo@tzi.org>, Jacob Davies <jacob@well.com>, JSON WG <json@ietf.org>
Subject: Re: [Json] JSON Log file encoding JSON-L
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "JavaScript Object Notation \(JSON\) WG mailing list" <json.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/json>, <mailto:json-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/json/>
List-Post: <mailto:json@ietf.org>
List-Help: <mailto:json-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/json>, <mailto:json-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 07 May 2014 21:40:18 -0000

On Wed, May 7, 2014 at 4:18 PM, Phillip Hallam-Baker <hallam@gmail.com> wrote:
> On Wed, May 7, 2014 at 5:04 PM, Nico Williams <nico@cryptonector.com> wrote:
>> On Wed, May 7, 2014 at 3:46 PM, Phillip Hallam-Baker <hallam@gmail.com> wrote:
>>> If I open up a file with an RS character in it using notepad, how is
>>> it going to look?
>>
>> Notepad, Wordpad, my Unix shells, my Unix $EDITOR -- all display it as
>> a space or not at all.
>
> So how can I look at a file and know if it is a well formed sequence or not?

Use a JSON text processor, like jq(1).  (I'll have to update jq to
teach it to ignore RS between texts at the top-level.)

>>> Since RS is effectively an obsolete character the best I would expect
>>> is to see ? all over the place.
>>
>> Nope.  And even so, who cares?  It's a log file, you'll not be editing it.
>
> I open log files with an editor very frequently.

First, try it.  Second, what?  Why edit logfiles?  I've been dealing
with logfiles for decades and I've never had to edit one before.  What
are editing them for?

> It is easy enough to detect the sequence '}' *ws* LF *ws '{', its a
> four state FSR. Why complicate things with characters that will cause
> detours through untested code paths?

It's only necessary to know anything about RS when recovering from a
failure to parse a presumably-truncated entry in the log.  And even
then, we can simply seek forward to the next RS or NL and try parsing
whatever's there.

Nico
--