Re: [openstack-dev] Tip: jsonformatter site for parsing/debugging logs

2016-01-21 Thread gord chung



On 21/01/2016 11:27 AM, Doug Hellmann wrote:

You can also do this using Python's json module from the command line:

$ echo '{"json":"obj"}' | python -m json.tool
{
   "json": "obj"
}

Doug

very useful... if you want a site,  i use http://pro.jsonlint.com/ 
(vladikr told me about it... he will be happy i mentioned his name here.)


cheers,

--
gord


__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] Tip: jsonformatter site for parsing/debugging logs

2016-01-21 Thread Doug Hellmann
Excerpts from Matt Riedemann's message of 2016-01-21 10:09:32 -0600:
> Are you tired of trying to strain your eyes to parse something like this 
> in the logs [1]?
> 
> vif=VIF({'profile': {}, 'ovs_interfaceid': 
> u'ac3ca8e7-c22d-4f63-9620-ce031bf3eaac', 'preserve_on_delete': False, 
> 'network': Network({'bridge': u'br-int', 'subnets': [Subnet({'ips': 
> [FixedIP({'meta': {}, 'version': 4, 'type': u'fixed', 'floating_ips': 
> [], 'address': u'10.100.0.18'})], 'version': 4, 'meta': {u'dhcp_server': 
> u'10.100.0.17'}, 'dns': [], 'routes': [], 'cidr': u'10.100.0.16/28', 
> 'gateway': IP({'meta': {}, 'version': None, 'type': u'gateway', 
> 'address': None})})], 'meta': {u'injected': False, u'tenant_id': 
> u'1d760ac487e24e06add18dacefa221a1'}, 'id': 
> u'b13e9828-2bd9-4fb4-a20d-a92e2a8c1a77', 'label': 
> u'tempest-network-smoke--1979535575'}), 'devname': u'tapac3ca8e7-c2', 
> 'vnic_type': u'normal', 'qbh_params': None, 'meta': {}, 'details': 
> {u'port_filter': True, u'ovs_hybrid_plug': True}, 'address': 
> u'fa:16:3e:0c:d3:95', 'active': False, 'type': u'ovs', 'id': 
> u'ac3ca8e7-c22d-4f63-9620-ce031bf3eaac', 'qbg_params': None}
> 
> I found https://jsonformatter.curiousconcept.com/ which is nice since 
> you can just copy that json from the logs and paste it into the text 
> area and format it (I disable validation).

You can also do this using Python's json module from the command line:

$ echo '{"json":"obj"}' | python -m json.tool
{
  "json": "obj"
}

Doug

__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


[openstack-dev] Tip: jsonformatter site for parsing/debugging logs

2016-01-21 Thread Matt Riedemann
Are you tired of trying to strain your eyes to parse something like this 
in the logs [1]?


vif=VIF({'profile': {}, 'ovs_interfaceid': 
u'ac3ca8e7-c22d-4f63-9620-ce031bf3eaac', 'preserve_on_delete': False, 
'network': Network({'bridge': u'br-int', 'subnets': [Subnet({'ips': 
[FixedIP({'meta': {}, 'version': 4, 'type': u'fixed', 'floating_ips': 
[], 'address': u'10.100.0.18'})], 'version': 4, 'meta': {u'dhcp_server': 
u'10.100.0.17'}, 'dns': [], 'routes': [], 'cidr': u'10.100.0.16/28', 
'gateway': IP({'meta': {}, 'version': None, 'type': u'gateway', 
'address': None})})], 'meta': {u'injected': False, u'tenant_id': 
u'1d760ac487e24e06add18dacefa221a1'}, 'id': 
u'b13e9828-2bd9-4fb4-a20d-a92e2a8c1a77', 'label': 
u'tempest-network-smoke--1979535575'}), 'devname': u'tapac3ca8e7-c2', 
'vnic_type': u'normal', 'qbh_params': None, 'meta': {}, 'details': 
{u'port_filter': True, u'ovs_hybrid_plug': True}, 'address': 
u'fa:16:3e:0c:d3:95', 'active': False, 'type': u'ovs', 'id': 
u'ac3ca8e7-c22d-4f63-9620-ce031bf3eaac', 'qbg_params': None}


I found https://jsonformatter.curiousconcept.com/ which is nice since 
you can just copy that json from the logs and paste it into the text 
area and format it (I disable validation).


Then I get something pretty like:

{
   'profile':{

   },
   'ovs_interfaceid':u'ac3ca8e7-c22d-4f63-9620-ce031bf3eaac',
   'preserve_on_delete':False,
   'network':Network(   {
  'bridge':u'br-int',
  'subnets':[
 Subnet( {
'ips':[
   FixedIP(   {
  'meta':{

  },
  'version':4,
  'type':u'fixed',
  'floating_ips':[

  ],
  'address':u'10.100.0.18'
   }   )
],
'version':4,
'meta':{
   u'dhcp_server':u'10.100.0.17'
},
'dns':[

],
'routes':[

],
'cidr':u'10.100.0.16/28',
'gateway':IP({
   'meta':{

   },
   'version':None,
   'type':u'gateway',
   'address':None
})
 } )
  ],
  'meta':{
 u'injected':False,
 u'tenant_id':u'1d760ac487e24e06add18dacefa221a1'
  },
  'id':u'b13e9828-2bd9-4fb4-a20d-a92e2a8c1a77',
  'label':u'tempest-network-smoke--1979535575'
   }   ),
   'devname':u'tapac3ca8e7-c2',
   'vnic_type':u'normal',
   'qbh_params':None,
   'meta':{

   },
   'details':{
  u'port_filter':True,
  u'ovs_hybrid_plug':True
   },
   'address':   u'fa:16:3e:0   c:   d3:95   ', '   active':False,
   'type':u'ovs',
   'id':u'ac3ca8e7-c22d-4f63-9620-ce031bf3eaac',
   'qbg_params':None
}

Yay now I can actually read this!

Just FYI for anyone that's had the same issues.

[1] 
http://logs.openstack.org/67/269867/4/check/gate-tempest-dsvm-neutron-src-os-brick/7617a9f/logs/screen-n-cpu.txt.gz#_2016-01-21_05_38_48_524


--

Thanks,

Matt Riedemann


__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev