Re: [Json] JSON Sequence support for log files

Nico Williams <nico@cryptonector.com> Thu, 08 May 2014 03:20 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 0DCD01A01FD for <json@ietfa.amsl.com>; Wed, 7 May 2014 20:20:49 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.043
X-Spam-Level:
X-Spam-Status: No, score=-1.043 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, HTML_MESSAGE=0.001, 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 UG-3rdRz2SjB for <json@ietfa.amsl.com>; Wed, 7 May 2014 20:20:48 -0700 (PDT)
Received: from homiemail-a36.g.dreamhost.com (sub4.mail.dreamhost.com [69.163.253.135]) by ietfa.amsl.com (Postfix) with ESMTP id F3D681A01F9 for <json@ietf.org>; Wed, 7 May 2014 20:20:47 -0700 (PDT)
Received: from homiemail-a36.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a36.g.dreamhost.com (Postfix) with ESMTP id AA49B778070 for <json@ietf.org>; Wed, 7 May 2014 20:20:43 -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=68Jbts89kqomPgXQqvCT bch10ak=; b=jagjywfwCX2QDGAt5+Jt8VADJnuXGHUf6cghepqvysIhAaD92erx vMeOtYrbSMxxW+8hAStkKnLlRjofStIJ3AeEyCJCBjiIf5d+OOWM4l+5KCMklULk WEfKz3Dc5A1uCJEIO+nDaov3Nc77ziGs0m8e0kKDr4oK9VMSVQivaLM=
Received: from mail-we0-f174.google.com (mail-we0-f174.google.com [74.125.82.174]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: nico@cryptonector.com) by homiemail-a36.g.dreamhost.com (Postfix) with ESMTPSA id 5BCB9778057 for <json@ietf.org>; Wed, 7 May 2014 20:20:43 -0700 (PDT)
Received: by mail-we0-f174.google.com with SMTP id k48so1919641wev.33 for <json@ietf.org>; Wed, 07 May 2014 20:20:42 -0700 (PDT)
MIME-Version: 1.0
X-Received: by 10.180.77.225 with SMTP id v1mr10555515wiw.5.1399519242239; Wed, 07 May 2014 20:20:42 -0700 (PDT)
Received: by 10.216.29.200 with HTTP; Wed, 7 May 2014 20:20:42 -0700 (PDT)
In-Reply-To: <255B9BB34FB7D647A506DC292726F6E11545BD3247@WSMSG3153V.srv.dir.telstra.com>
References: <CAK3OfOjfr_KP+bu977CY2-8oCqO11fh_wfUDuj3LJ3JVrqCXaQ@mail.gmail.com> <CAMm+Lwh9rQf3h-Nw8fgtrOqyCL+oPXOc0-xBdhma2Aqe=OjipA@mail.gmail.com> <CAK3OfOhv0oUWJZPb11SksxDJ-xK8OghUwBt7Y75kuGgOiGD-EA@mail.gmail.com> <255B9BB34FB7D647A506DC292726F6E11545BD3247@WSMSG3153V.srv.dir.telstra.com>
Date: Wed, 07 May 2014 22:20:42 -0500
Message-ID: <CAK3OfOhyQfCogRLwnLS9ayYvEDO-7fkwLDgrYVv6PQegGY2iZw@mail.gmail.com>
From: Nico Williams <nico@cryptonector.com>
To: "Manger, James" <James.H.Manger@team.telstra.com>
Content-Type: multipart/alternative; boundary="f46d043c82464a44c204f8daf7b5"
Archived-At: http://mailarchive.ietf.org/arch/msg/json/_FwZhX5aFUmob-u0dAyKPpOJQX8
Cc: Phillip Hallam-Baker <hallam@gmail.com>, "json@ietf.org" <json@ietf.org>
Subject: Re: [Json] JSON Sequence support for log files
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: Thu, 08 May 2014 03:20:49 -0000

>
> > In fact, any sequence of ( %x22 / "]" / "}" ) %x0A ( %22 / "{" / "[" )
> > works!  Thus even for logfiles we can have arrays, objects, and
> > strings at the top-level.
>
>
> Syncing to a boundary in the middle of a JSON sequence or log isn't a good
> reason for RS. You can sync without RS. I think the following detects a
> boundary between any JSON values.
>
> ( "}" / "]" / %x22 / "e" / "l" / DIGIT ) *ws NL *ws ( "{" / "[" / %x22 /
> "t" / "f" / "n" / "-" / DIGIT )
>

Oh, good point.  Of course, it's easier to seek to a single byte, but since
I'd not require RS, might as well accept a somewhat more complex resync
process.

Note that this does require prefixing texts with whitespace.

RS adds complexity (eg extra steps to strip RSs before passing to JSON
> parser).


Both add complexity, but I agree that your approach is better than RS.

Nico
--