I am performing some testing in-house. When I run your script via powershell, it does not appear to work properly. However, if I send the line directly using linux, it's picked up and works properly. This makes me think that Windows is adding something to the log-line when processing the powershell script - perhaps a hidden character or similar. I took a tcpdump of either capture and diff'd them:
Code: Select all
[root@localhost ~]# diff /root/json1 /root/json2
1,27c1,30
< 17:42:07.198090 IP x.x.x.x.61737 > x.x.x.x.5551: Flags [S], seq 4279265083, win 64240, options [mss 1460,nop,wscale 2,nop,nop,sackOK], length 0
< 0x0000: 4500 0034 7c69 4000 7f06 f356 c0a8 05e9 E..4|[email protected]....
< 0x0010: c0a8 04ca f129 15af ff10 673b 0000 0000 .....)....g;....
< 0x0020: 8002 faf0 7afc 0000 0204 05b4 0103 0302 ....z...........
< 0x0030: 0101 0402 ....
< 17:42:07.198638 IP x.x.x.x.61737 > x.x.x.x.5551: Flags [.], ack 1830534608, win 16060, length 0
< 0x0000: 4500 0028 7c6a 4000 7f06 f361 c0a8 05e9 E..(|[email protected]....
< 0x0010: c0a8 04ca f129 15af ff10 673c 6d1b bdd0 .....)....g<m...
< 0x0020: 5010 3ebc 4d02 0000 0000 0000 0000 P.>.M.........
< 17:42:07.199567 IP x.x.x.x.61737 > x.x.x.x.5551: Flags [P.], seq 0:89, ack 1, win 16060, length 89
< 0x0000: 4500 0081 7c6b 4000 7f06 f307 c0a8 05e9 E...|k@.........
< 0x0010: c0a8 04ca f129 15af ff10 673c 6d1b bdd0 .....)....g<m...
< 0x0020: 5018 3ebc a170 0000 7b22 4e61 6d65 223a P.>..p..{"Name":
< 0x0030: 224a 736f 6e53 6d75 7266 222c 2241 6765 "JsonSmurf","Age
< 0x0040: 223a 3334 2c22 5765 6967 6874 223a 3634 ":34,"Weight":64
< 0x0050: 2c22 486f 6262 6965 7373 223a 5b22 4164 ,"Hobbiess":["Ad
< 0x0060: 7665 6e74 7572 6522 2c22 5265 6164 696e venture","Readin
< 0x0070: 6722 2c22 4d6f 6e69 746f 7269 6e67 225d g","Monitoring"]
< 0x0080: 7d }
< 17:42:07.200559 IP x.x.x.x.61737 > x.x.x.x.5551: Flags [F.], seq 89, ack 1, win 16060, length 0
< 0x0000: 4500 0028 7c6d 4000 7f06 f35e c0a8 05e9 E..(|m@....^....
< 0x0010: c0a8 04ca f129 15af ff10 6795 6d1b bdd0 .....)....g.m...
< 0x0020: 5011 3ebc 4ca8 0000 0000 0000 0000 P.>.L.........
< 17:42:07.203033 IP x.x.x.x.61737 > x.x.x.x.5551: Flags [.], ack 2, win 16060, length 0
< 0x0000: 4500 0028 7c6e 4000 7f06 f35d c0a8 05e9 E..(|n@....]....
< 0x0010: c0a8 04ca f129 15af ff10 6796 6d1b bdd1 .....)....g.m...
< 0x0020: 5010 3ebc 4ca7 0000 0000 0000 0000 P.>.L.........
---
> 17:42:31.926129 IP x.x.x.x.38954 > x.x.x.x.5551: Flags [S], seq 2652321108, win 14600, options [mss 1460,sackOK,TS val 185267070 ecr 0,nop,wscale 6], length 0
> 0x0000: 4500 003c c62a 4000 4006 e9e3 c0a8 0492 E..<.*@.@.......
> 0x0010: c0a8 04cb 982a 15af 9e17 3554 0000 0000 .....*....5T....
> 0x0020: a002 3908 047d 0000 0204 05b4 0402 080a ..9..}..........
> 0x0030: 0b0a f37e 0000 0000 0103 0306 ...~........
> 17:42:31.926314 IP x.x.x.x.38954 > x.x.x.x.5551: Flags [.], ack 2577196732, win 229, options [nop,nop,TS val 185267070 ecr 2583056353], length 0
> 0x0000: 4500 0034 c62b 4000 4006 e9ea c0a8 0492 E..4.+@.@.......
> 0x0010: c0a8 04cb 982a 15af 9e17 3555 999c e6bc .....*....5U....
> 0x0020: 8010 00e5 012a 0000 0101 080a 0b0a f37e .....*.........~
> 0x0030: 99f6 4fe1 ..O.
> 17:42:31.926339 IP x.x.x.x.38954 > x.x.x.x.5551: Flags [P.], seq 0:90, ack 1, win 229, options [nop,nop,TS val 185267070 ecr 2583056353], length 90
> 0x0000: 4500 008e c62c 4000 4006 e98f c0a8 0492 E....,@.@.......
> 0x0010: c0a8 04cb 982a 15af 9e17 3555 999c e6bc .....*....5U....
> 0x0020: 8018 00e5 558d 0000 0101 080a 0b0a f37e ....U..........~
> 0x0030: 99f6 4fe1 7b22 4e61 6d65 223a 224a 736f ..O.{"Name":"Jso
> 0x0040: 6e53 6d75 7266 222c 2241 6765 223a 3334 nSmurf","Age":34
> 0x0050: 2c22 5765 6967 6874 223a 3634 2c22 486f ,"Weight":64,"Ho
> 0x0060: 6262 6965 7373 223a 5b22 4164 7665 6e74 bbiess":["Advent
> 0x0070: 7572 6522 2c22 5265 6164 696e 6722 2c22 ure","Reading","
> 0x0080: 4d6f 6e69 746f 7269 6e67 225d 7d0a Monitoring"]}.
> 17:42:31.926447 IP x.x.x.x.38954 > x.x.x.x.5551: Flags [F.], seq 90, ack 1, win 229, options [nop,nop,TS val 185267070 ecr 2583056353], length 0
> 0x0000: 4500 0034 c62d 4000 4006 e9e8 c0a8 0492 E..4.-@.@.......
> 0x0010: c0a8 04cb 982a 15af 9e17 35af 999c e6bc .....*....5.....
> 0x0020: 8011 00e5 00cf 0000 0101 080a 0b0a f37e ...............~
> 0x0030: 99f6 4fe1 ..O.
> 17:42:31.930697 IP x.x.x.x.38954 > x.x.x.x.5551: Flags [.], ack 2, win 229, options [nop,nop,TS val 185267074 ecr 2583056357], length 0
> 0x0000: 4500 0034 c62e 4000 4006 e9e7 c0a8 0492 E..4..@.@.......
> 0x0010: c0a8 04cb 982a 15af 9e17 35b0 999c e6bd .....*....5.....
> 0x0020: 8010 00e5 00c6 0000 0101 080a 0b0a f382 ................
> 0x0030: 99f6 4fe5 ..O.
json1 is being sent from windows using your powershell script, while json2 is being sent via a different linux box directly. I can't see any distinct differences between the two at the moment. I will do further testing, but I figured I would provide you with what I have so far.