]> git.immae.eu Git - github/fretlink/haskell-graylog.git/commitdiff
Implemented UDP chunking.
authorAndrewRademacher <andrewrademacher@gmail.com>
Sun, 28 Feb 2016 18:58:56 +0000 (12:58 -0600)
committerAndrewRademacher <andrewrademacher@gmail.com>
Sun, 28 Feb 2016 18:58:56 +0000 (12:58 -0600)
graylog.cabal
src/Graylog/Types.hs
src/Graylog/UDP.hs
test/Test/Graylog/UDP.hs
test/Test/Graylog/UDP/large-sample.json [new file with mode: 0644]

index cc6b2d82ea666fe4630bcf8df9b0a69d000e3820..47c8b7d666c590318efb2cdeb17ef99297e5bb80 100644 (file)
@@ -51,6 +51,8 @@ test-suite test-state
 
                      ,  aeson
                      ,  aeson-casing
+                     ,  bytestring
+                     ,  file-embed
                      ,  network
                      ,  scientific
                      ,  tasty
index 8fad8cc3f1e3ba6e72807904d9acdc5baf255aa2..5c32a8b52d74a5ebe7a8255ea66607f4a126a5d0 100644 (file)
@@ -8,6 +8,7 @@ module Graylog.Types
    , _graylogAddress
    , _graylogSocket
    , _graylogHostName
+   , _graylogChunkSize
    , ChunkSize
 
    , defaultChunkSize
@@ -38,7 +39,9 @@ defaultChunkSize = 8192
 
 openGraylog
    :: HostName -> ServiceName -> ChunkSize -> IO (Either String Graylog)
-openGraylog h p cksize = getAddrInfo Nothing (Just h) (Just p) >>= \case
+openGraylog h p cksize
+   | cksize < 1024 = return $ Left "ChunkSize must be at least 1024."
+   | otherwise     = getAddrInfo Nothing (Just h) (Just p) >>= \case
    []     -> return $ Left "No address info found."
    infos ->
       case find (\i -> addrSocketType i == Datagram) infos of
index c925d7ead33d339be0280e02796f0fb1cb9a8da9..cd7fe5a1450fc1cb9f0b48649b9487c084e3f0ab 100644 (file)
@@ -5,37 +5,45 @@ module Graylog.UDP
    ) where
 
 import           Data.Aeson
-{-import           Data.ByteString.Builder-}
-{-import qualified Data.ByteString.Lazy           as LBS-}
-{-import           Data.Word-}
+import           Data.ByteString.Builder
+import qualified Data.ByteString.Lazy           as LBS
+import           Data.Monoid
+import           Data.Word
 import           Network.Socket.ByteString.Lazy
-{-import           System.Random-}
+import           System.Random
 
 import           Graylog.Gelf                   as Export
 import           Graylog.Types                  as Export
 
 sendLog :: Graylog -> GELF -> IO ()
 sendLog glog msg = do
-   _ <- send (_graylogSocket glog) raw
-   print raw
-   return ()
+   cks <- chunky glog raw
+   mapM_ (send $ _graylogSocket glog) cks
    where
       raw = encode msg
 
-{-sendLog :: Graylog -> GELF -> IO ()-}
-{-sendLog glog msg = do-}
-   {-cks <- chunky glog raw-}
-   {-mapM_ (send $ _graylogSocket glog) cks-}
-   {-where-}
-      {-raw = encode msg-}
+chunky :: Graylog -> LBS.ByteString -> IO [LBS.ByteString]
+chunky glog raw = do
+   groupId <- randomIO
+   let groups = divide totalNum raw
+   return $ append groupId groups seqNums
+   where
+      magic           = word8 0x1e <> word8 0x0f
+      seqNums         = [0..] :: [Word8]
+      totalNum        = if excess > 0 then count + 1 else count
+      (count, excess) = quotRem (LBS.length raw) gsize
+      hlen            = 12
+      gsize           = (fromIntegral (_graylogChunkSize glog)) - hlen
+
+      divide   0 dat = [dat]
+      divide num dat = let (pre, post) = LBS.splitAt gsize dat
+                        in pre : divide (num - 1) post
 
-{-chunky :: Graylog -> LBS.ByteString -> IO [LBS.ByteString]-}
-{-chunky glog raw = do-}
-   {-groupId <- randomIO-}
-   {-splitAt gsize-}
-   {-where-}
-      {-magic           = word8 0x1e <> word8 0x0f-}
-      {-seqNum          = undefined-}
-      {-(count, excess) = quotRem (LBS.length raw) gzie-}
-      {-hlen            = 12-}
-      {-gsize           = (fromIntegral (_graylogChunkSize glog)) - hlen-}
+      append _   []     _      = []
+      append _   _      []     = error "the impossible has happened."
+      append gid (g:gs) (s:ss) = (toLazyByteString
+         $ magic
+        <> word64BE gid
+        <> word8 s
+        <> word8 (fromIntegral totalNum)
+        <> lazyByteString g) : append gid gs ss
index d62f11a25a0e39b078139181eed040306a6bf2f9..6534c6955694efc62044a337acd3cd698df460ca 100644 (file)
@@ -1,16 +1,23 @@
 {-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE TemplateHaskell   #-}
 
 module Test.Graylog.UDP where
 
+import qualified Data.ByteString    as BS
+import           Data.FileEmbed
+import qualified Data.Text.Encoding as T
 import           Test.Tasty
 import           Test.Tasty.HUnit
 
 import           Graylog.UDP
 
+largeSample :: BS.ByteString
+largeSample = $(embedFile "./test/Test/Graylog/UDP/large-sample.json")
+
 tests :: TestTree
 tests = testGroup "Test.Graylog.UDP"
-   {-[ testCase "Send: Sample" case_validateSomething-}
    [ testCase "Send sample message." case_sendSample
+   , testCase "Send large sample message." case_sendLargeSample
    ]
 
 case_sendSample :: IO ()
@@ -18,6 +25,17 @@ case_sendSample = do
    eglog <- openGraylog "192.168.99.100" "12201" defaultChunkSize
    case eglog of
       Left  e -> assertFailure e
-      Right g -> sendLog g sample
+      Right g -> sendLog g sample >> closeGraylog g
    where
       sample = simpleGelf "localhost" "hello world!"
+
+case_sendLargeSample :: IO ()
+case_sendLargeSample = do
+   eglog <- openGraylog "192.168.99.100" "12201" defaultChunkSize
+   case eglog of
+      Left  e -> assertFailure e
+      Right g -> sendLog g sample >> closeGraylog g
+   where
+      sample = (simpleGelf "localhost" "hello world!")
+                  { _gelfFullMessage = Just $ T.decodeUtf8 largeSample }
+
diff --git a/test/Test/Graylog/UDP/large-sample.json b/test/Test/Graylog/UDP/large-sample.json
new file mode 100644 (file)
index 0000000..1a047fb
--- /dev/null
@@ -0,0 +1,677 @@
+[
+  {
+    "_id": "56d34108404074efe47fe0ff",
+    "index": 0,
+    "guid": "eb3d3a63-834a-4e59-b6fe-0eb0205c5766",
+    "isActive": true,
+    "balance": "$2,268.29",
+    "picture": "http://placehold.it/32x32",
+    "age": 21,
+    "eyeColor": "green",
+    "name": "Hendricks Duffy",
+    "gender": "male",
+    "company": "VERAQ",
+    "email": "hendricksduffy@veraq.com",
+    "phone": "+1 (904) 512-3102",
+    "address": "134 Varanda Place, Manila, Alaska, 9021",
+    "about": "Lorem reprehenderit elit amet do velit ea sunt voluptate nisi duis. Mollit sint occaecat aute amet esse occaecat sunt minim pariatur consequat sit aute dolor amet. Culpa duis do sunt ipsum dolore tempor. Tempor cillum elit officia pariatur duis irure irure quis quis do elit. Lorem magna enim aliqua id proident voluptate magna ex laborum sit in laboris. Ullamco tempor aliqua duis cillum exercitation velit id dolore consectetur pariatur Lorem. Dolore cupidatat elit duis aliquip sunt.\r\n",
+    "registered": "2014-05-28T05:46:32 +05:00",
+    "latitude": -46.834546,
+    "longitude": 56.003786,
+    "tags": [
+      "ex",
+      "excepteur",
+      "excepteur",
+      "deserunt",
+      "aliquip",
+      "culpa",
+      "laboris"
+    ],
+    "friends": [
+      {
+        "id": 0,
+        "name": "Wolf Noble"
+      },
+      {
+        "id": 1,
+        "name": "Shelby Knapp"
+      },
+      {
+        "id": 2,
+        "name": "Carly Snider"
+      }
+    ],
+    "greeting": "Hello, Hendricks Duffy! You have 9 unread messages.",
+    "favoriteFruit": "apple"
+  },
+  {
+    "_id": "56d3410843a42c9fa5359530",
+    "index": 1,
+    "guid": "3b6f83ae-ac2e-412b-8d03-174b0fb7d609",
+    "isActive": false,
+    "balance": "$1,660.14",
+    "picture": "http://placehold.it/32x32",
+    "age": 28,
+    "eyeColor": "green",
+    "name": "Wilkinson Wade",
+    "gender": "male",
+    "company": "BYTREX",
+    "email": "wilkinsonwade@bytrex.com",
+    "phone": "+1 (826) 446-3590",
+    "address": "955 Jamison Lane, Nord, Texas, 942",
+    "about": "Aliqua in nostrud et excepteur nisi. Nisi tempor mollit sint eiusmod dolore aliquip minim. Ullamco ut dolore labore irure sit.\r\n",
+    "registered": "2016-01-30T11:46:52 +06:00",
+    "latitude": 34.701696,
+    "longitude": 64.598148,
+    "tags": [
+      "laboris",
+      "sunt",
+      "consequat",
+      "fugiat",
+      "consectetur",
+      "proident",
+      "tempor"
+    ],
+    "friends": [
+      {
+        "id": 0,
+        "name": "Opal Juarez"
+      },
+      {
+        "id": 1,
+        "name": "Holland Griffith"
+      },
+      {
+        "id": 2,
+        "name": "Ballard Craft"
+      }
+    ],
+    "greeting": "Hello, Wilkinson Wade! You have 1 unread messages.",
+    "favoriteFruit": "banana"
+  },
+  {
+    "_id": "56d341084128d62763e9caec",
+    "index": 2,
+    "guid": "de74c233-aa79-4682-bc53-5bc8a3a18e59",
+    "isActive": false,
+    "balance": "$2,356.76",
+    "picture": "http://placehold.it/32x32",
+    "age": 23,
+    "eyeColor": "brown",
+    "name": "Elva Greer",
+    "gender": "female",
+    "company": "NIKUDA",
+    "email": "elvagreer@nikuda.com",
+    "phone": "+1 (935) 556-3236",
+    "address": "292 Jerome Avenue, Maybell, Florida, 1253",
+    "about": "Consectetur aliqua ex labore anim quis elit dolor. Aute velit velit consectetur ullamco ea aliquip Lorem magna. Exercitation incididunt labore nostrud ipsum et cillum tempor aliqua laboris in amet minim veniam. Cillum cupidatat qui non aute reprehenderit fugiat sit.\r\n",
+    "registered": "2015-02-19T05:31:22 +06:00",
+    "latitude": -28.943551,
+    "longitude": -5.000076,
+    "tags": [
+      "officia",
+      "ex",
+      "qui",
+      "ullamco",
+      "consequat",
+      "mollit",
+      "consectetur"
+    ],
+    "friends": [
+      {
+        "id": 0,
+        "name": "Louise Oneal"
+      },
+      {
+        "id": 1,
+        "name": "Melba Glass"
+      },
+      {
+        "id": 2,
+        "name": "Jillian Wright"
+      }
+    ],
+    "greeting": "Hello, Elva Greer! You have 6 unread messages.",
+    "favoriteFruit": "apple"
+  },
+  {
+    "_id": "56d34108067fc7188e1205ff",
+    "index": 3,
+    "guid": "37433441-2f81-4d13-a827-2790bf3adb3d",
+    "isActive": false,
+    "balance": "$2,202.96",
+    "picture": "http://placehold.it/32x32",
+    "age": 31,
+    "eyeColor": "brown",
+    "name": "Brewer Gordon",
+    "gender": "male",
+    "company": "HARMONEY",
+    "email": "brewergordon@harmoney.com",
+    "phone": "+1 (884) 479-3048",
+    "address": "731 Grattan Street, Boomer, Massachusetts, 8660",
+    "about": "Cupidatat dolore id aute laborum est aliqua sunt. Proident labore deserunt sit fugiat et magna dolore. Nulla id esse eiusmod ut Lorem esse voluptate Lorem eu aute veniam est pariatur. Eu amet ipsum dolor mollit ullamco. Aute velit velit incididunt eu aute amet nulla sunt enim ea amet minim. Non consequat veniam commodo veniam non.\r\n",
+    "registered": "2015-04-02T06:30:21 +05:00",
+    "latitude": -16.266799,
+    "longitude": -7.521735,
+    "tags": [
+      "do",
+      "do",
+      "nostrud",
+      "consequat",
+      "dolore",
+      "et",
+      "consectetur"
+    ],
+    "friends": [
+      {
+        "id": 0,
+        "name": "Bobbi Guzman"
+      },
+      {
+        "id": 1,
+        "name": "Evangeline Clemons"
+      },
+      {
+        "id": 2,
+        "name": "Alvarez Hinton"
+      }
+    ],
+    "greeting": "Hello, Brewer Gordon! You have 9 unread messages.",
+    "favoriteFruit": "banana"
+  },
+  {
+    "_id": "56d34108ba44995b4d5f9789",
+    "index": 4,
+    "guid": "5ddb0064-f2a6-43ae-ae47-81182f725059",
+    "isActive": true,
+    "balance": "$1,024.75",
+    "picture": "http://placehold.it/32x32",
+    "age": 28,
+    "eyeColor": "blue",
+    "name": "Pamela Sloan",
+    "gender": "female",
+    "company": "ULTRIMAX",
+    "email": "pamelasloan@ultrimax.com",
+    "phone": "+1 (970) 492-2905",
+    "address": "241 Hastings Street, Blodgett, North Carolina, 2051",
+    "about": "Eiusmod labore commodo dolore pariatur. Sint culpa magna ut enim fugiat laboris cupidatat excepteur fugiat nostrud occaecat. Dolor cillum occaecat exercitation minim quis consectetur enim sit. Sunt aute labore culpa occaecat. Eu do nulla pariatur sint sit anim proident aliqua. Commodo ullamco fugiat duis velit ut sint velit ea. Elit ut ut sint aliqua laborum incididunt anim Lorem occaecat in.\r\n",
+    "registered": "2015-06-01T07:14:15 +05:00",
+    "latitude": -57.021481,
+    "longitude": -2.638072,
+    "tags": [
+      "Lorem",
+      "eiusmod",
+      "laboris",
+      "Lorem",
+      "nulla",
+      "deserunt",
+      "aliqua"
+    ],
+    "friends": [
+      {
+        "id": 0,
+        "name": "Vinson Maldonado"
+      },
+      {
+        "id": 1,
+        "name": "Ball Jimenez"
+      },
+      {
+        "id": 2,
+        "name": "Riddle Gallegos"
+      }
+    ],
+    "greeting": "Hello, Pamela Sloan! You have 3 unread messages.",
+    "favoriteFruit": "strawberry"
+  },
+  {
+    "_id": "56d34108e0e975a3a1b5a57f",
+    "index": 5,
+    "guid": "4b8468bd-78b1-4bb1-bdf9-bce85d2fe4b0",
+    "isActive": false,
+    "balance": "$3,046.83",
+    "picture": "http://placehold.it/32x32",
+    "age": 38,
+    "eyeColor": "brown",
+    "name": "Angeline Ford",
+    "gender": "female",
+    "company": "EGYPTO",
+    "email": "angelineford@egypto.com",
+    "phone": "+1 (871) 591-2599",
+    "address": "168 Hoyts Lane, Ilchester, District Of Columbia, 8583",
+    "about": "Sint quis nostrud ex occaecat cillum anim veniam aute ex ipsum minim dolore. Duis reprehenderit sint proident deserunt laboris veniam fugiat aliqua elit. Et cupidatat exercitation non est nisi nisi. Incididunt exercitation nostrud amet nostrud non do excepteur et id consectetur proident. Deserunt commodo fugiat culpa do laboris.\r\n",
+    "registered": "2015-08-23T08:11:58 +05:00",
+    "latitude": 84.55975,
+    "longitude": 56.451822,
+    "tags": [
+      "pariatur",
+      "ad",
+      "eiusmod",
+      "ea",
+      "amet",
+      "occaecat",
+      "exercitation"
+    ],
+    "friends": [
+      {
+        "id": 0,
+        "name": "Houston Hobbs"
+      },
+      {
+        "id": 1,
+        "name": "Audrey Hood"
+      },
+      {
+        "id": 2,
+        "name": "Ila Bowman"
+      }
+    ],
+    "greeting": "Hello, Angeline Ford! You have 7 unread messages.",
+    "favoriteFruit": "strawberry"
+  },
+  {
+    "_id": "56d341081ecd3dc046705a1c",
+    "index": 6,
+    "guid": "ad00d34a-4eb3-412c-b5af-f11358d63761",
+    "isActive": true,
+    "balance": "$3,371.87",
+    "picture": "http://placehold.it/32x32",
+    "age": 29,
+    "eyeColor": "brown",
+    "name": "Kelli Schroeder",
+    "gender": "female",
+    "company": "GAZAK",
+    "email": "kellischroeder@gazak.com",
+    "phone": "+1 (877) 547-3673",
+    "address": "581 College Place, Nescatunga, Rhode Island, 5472",
+    "about": "Culpa amet adipisicing consectetur laboris veniam reprehenderit et mollit quis enim tempor. Amet officia excepteur adipisicing duis velit esse aliqua eu nulla aliqua culpa. Dolor aliquip irure consectetur aliquip nisi sint excepteur reprehenderit voluptate. Ipsum nostrud eiusmod excepteur voluptate nulla esse nisi culpa. Consequat ullamco aliquip pariatur duis labore ullamco do ea cupidatat enim exercitation. Sunt sit ullamco veniam dolore consectetur pariatur commodo consectetur proident do est.\r\n",
+    "registered": "2014-11-03T01:22:40 +06:00",
+    "latitude": 45.221417,
+    "longitude": -66.436558,
+    "tags": [
+      "laborum",
+      "est",
+      "proident",
+      "consequat",
+      "cillum",
+      "nulla",
+      "anim"
+    ],
+    "friends": [
+      {
+        "id": 0,
+        "name": "Rosanne Gregory"
+      },
+      {
+        "id": 1,
+        "name": "Foley Whitney"
+      },
+      {
+        "id": 2,
+        "name": "Deanna Watkins"
+      }
+    ],
+    "greeting": "Hello, Kelli Schroeder! You have 2 unread messages.",
+    "favoriteFruit": "strawberry"
+  },
+  {
+    "_id": "56d341082661728cbb864941",
+    "index": 7,
+    "guid": "ba7bccbc-2911-4d8a-81a6-cca198dc0bf6",
+    "isActive": false,
+    "balance": "$2,329.72",
+    "picture": "http://placehold.it/32x32",
+    "age": 29,
+    "eyeColor": "blue",
+    "name": "Francesca Stanton",
+    "gender": "female",
+    "company": "EMTRAK",
+    "email": "francescastanton@emtrak.com",
+    "phone": "+1 (934) 421-3570",
+    "address": "823 Terrace Place, Alderpoint, Nebraska, 3297",
+    "about": "Eu incididunt id fugiat pariatur cupidatat aliqua id culpa est aliquip cupidatat aliqua qui. Reprehenderit excepteur exercitation labore tempor excepteur elit occaecat aliquip proident proident excepteur sit. Minim duis enim laboris esse ea dolore aliquip. Duis pariatur voluptate deserunt magna non. Laborum elit eiusmod incididunt amet eu non ut ut.\r\n",
+    "registered": "2016-01-31T10:53:50 +06:00",
+    "latitude": 60.764415,
+    "longitude": 3.54402,
+    "tags": [
+      "ipsum",
+      "ullamco",
+      "sit",
+      "cupidatat",
+      "sint",
+      "voluptate",
+      "quis"
+    ],
+    "friends": [
+      {
+        "id": 0,
+        "name": "Daniels Boyd"
+      },
+      {
+        "id": 1,
+        "name": "Freeman Guerrero"
+      },
+      {
+        "id": 2,
+        "name": "Montoya Russell"
+      }
+    ],
+    "greeting": "Hello, Francesca Stanton! You have 10 unread messages.",
+    "favoriteFruit": "strawberry"
+  },
+  {
+    "_id": "56d34108f2dd95917c4c3bed",
+    "index": 8,
+    "guid": "9c5d5f6e-efd8-493b-9439-bf9be2466f4b",
+    "isActive": true,
+    "balance": "$1,829.87",
+    "picture": "http://placehold.it/32x32",
+    "age": 28,
+    "eyeColor": "brown",
+    "name": "Norris Workman",
+    "gender": "male",
+    "company": "APPLIDEC",
+    "email": "norrisworkman@applidec.com",
+    "phone": "+1 (937) 448-2116",
+    "address": "815 Coleridge Street, Torboy, Washington, 2229",
+    "about": "Ex aute duis consequat aliquip dolore qui. Cupidatat reprehenderit incididunt nisi nisi exercitation ut non nostrud eiusmod. Anim esse commodo tempor Lorem sint sint labore irure minim nisi do. Veniam reprehenderit fugiat id quis proident. Ad sint ullamco do exercitation consequat.\r\n",
+    "registered": "2015-07-19T02:35:57 +05:00",
+    "latitude": 34.371249,
+    "longitude": 91.512571,
+    "tags": [
+      "mollit",
+      "officia",
+      "deserunt",
+      "ad",
+      "id",
+      "dolore",
+      "proident"
+    ],
+    "friends": [
+      {
+        "id": 0,
+        "name": "Marilyn Higgins"
+      },
+      {
+        "id": 1,
+        "name": "Elvia Kramer"
+      },
+      {
+        "id": 2,
+        "name": "Sloan Soto"
+      }
+    ],
+    "greeting": "Hello, Norris Workman! You have 5 unread messages.",
+    "favoriteFruit": "strawberry"
+  },
+  {
+    "_id": "56d34108ffc2698a49a1800f",
+    "index": 9,
+    "guid": "445cf14a-a033-4ce0-a9bd-384e1ad04147",
+    "isActive": false,
+    "balance": "$1,794.08",
+    "picture": "http://placehold.it/32x32",
+    "age": 26,
+    "eyeColor": "green",
+    "name": "Gallagher Stout",
+    "gender": "male",
+    "company": "COMBOGENE",
+    "email": "gallagherstout@combogene.com",
+    "phone": "+1 (804) 539-3176",
+    "address": "301 Broadway , Williams, Federated States Of Micronesia, 7658",
+    "about": "Proident proident qui nostrud laborum ex elit id occaecat. Dolor cillum tempor aliquip incididunt deserunt aute pariatur. Enim consectetur incididunt reprehenderit reprehenderit veniam culpa velit culpa exercitation incididunt ea ullamco deserunt veniam. Exercitation ut sunt laboris do eiusmod dolor deserunt nulla aliquip sit anim. Est consequat veniam veniam ad esse eu incididunt. Id veniam nisi ullamco deserunt nulla. Irure officia aliqua quis consequat.\r\n",
+    "registered": "2015-11-30T08:18:33 +06:00",
+    "latitude": -13.868516,
+    "longitude": 6.1512,
+    "tags": [
+      "cupidatat",
+      "duis",
+      "ullamco",
+      "veniam",
+      "occaecat",
+      "id",
+      "nostrud"
+    ],
+    "friends": [
+      {
+        "id": 0,
+        "name": "Flowers Calhoun"
+      },
+      {
+        "id": 1,
+        "name": "Marie Holt"
+      },
+      {
+        "id": 2,
+        "name": "Althea Casey"
+      }
+    ],
+    "greeting": "Hello, Gallagher Stout! You have 7 unread messages.",
+    "favoriteFruit": "strawberry"
+  },
+  {
+    "_id": "56d34108c24e283e1b09fa92",
+    "index": 10,
+    "guid": "684e2aa4-1d23-4d3e-91e1-04ab7956cb00",
+    "isActive": false,
+    "balance": "$3,705.99",
+    "picture": "http://placehold.it/32x32",
+    "age": 31,
+    "eyeColor": "green",
+    "name": "Banks Kaufman",
+    "gender": "male",
+    "company": "XIXAN",
+    "email": "bankskaufman@xixan.com",
+    "phone": "+1 (825) 402-3342",
+    "address": "321 Coyle Street, Elfrida, Puerto Rico, 801",
+    "about": "Qui esse irure elit occaecat dolor mollit nulla cupidatat incididunt non ipsum cupidatat elit. Et culpa dolore adipisicing eiusmod sint nostrud mollit. Adipisicing velit culpa veniam et dolore. Ullamco cillum nulla reprehenderit reprehenderit incididunt.\r\n",
+    "registered": "2015-05-05T05:29:02 +05:00",
+    "latitude": -83.369996,
+    "longitude": -153.192047,
+    "tags": [
+      "fugiat",
+      "do",
+      "est",
+      "ut",
+      "mollit",
+      "duis",
+      "magna"
+    ],
+    "friends": [
+      {
+        "id": 0,
+        "name": "Lidia Coffey"
+      },
+      {
+        "id": 1,
+        "name": "Sheryl Greene"
+      },
+      {
+        "id": 2,
+        "name": "Chang Morris"
+      }
+    ],
+    "greeting": "Hello, Banks Kaufman! You have 2 unread messages.",
+    "favoriteFruit": "banana"
+  },
+  {
+    "_id": "56d3410802c1ad2caf63487c",
+    "index": 11,
+    "guid": "f4fdfb38-0c18-457f-a2b1-2ffd8a52e311",
+    "isActive": false,
+    "balance": "$3,308.76",
+    "picture": "http://placehold.it/32x32",
+    "age": 31,
+    "eyeColor": "green",
+    "name": "Sadie Spencer",
+    "gender": "female",
+    "company": "COGENTRY",
+    "email": "sadiespencer@cogentry.com",
+    "phone": "+1 (829) 416-3379",
+    "address": "356 Milton Street, Siglerville, Montana, 672",
+    "about": "Velit voluptate Lorem sint irure esse nostrud. Officia ex aute consectetur culpa in do culpa dolore in. Laboris dolore laboris id cupidatat exercitation.\r\n",
+    "registered": "2015-11-16T03:18:50 +06:00",
+    "latitude": -65.284906,
+    "longitude": -100.539994,
+    "tags": [
+      "cupidatat",
+      "nulla",
+      "aliquip",
+      "qui",
+      "pariatur",
+      "esse",
+      "in"
+    ],
+    "friends": [
+      {
+        "id": 0,
+        "name": "Rosella Henson"
+      },
+      {
+        "id": 1,
+        "name": "Luella Cervantes"
+      },
+      {
+        "id": 2,
+        "name": "Beatrice Cannon"
+      }
+    ],
+    "greeting": "Hello, Sadie Spencer! You have 7 unread messages.",
+    "favoriteFruit": "strawberry"
+  },
+  {
+    "_id": "56d34108cc0ed7679a460e24",
+    "index": 12,
+    "guid": "d034649e-b506-485f-81de-e6e87f257825",
+    "isActive": false,
+    "balance": "$2,722.49",
+    "picture": "http://placehold.it/32x32",
+    "age": 36,
+    "eyeColor": "blue",
+    "name": "Marguerite Sargent",
+    "gender": "female",
+    "company": "GENMEX",
+    "email": "margueritesargent@genmex.com",
+    "phone": "+1 (972) 407-2114",
+    "address": "730 Richards Street, Malott, West Virginia, 4236",
+    "about": "Sit quis exercitation tempor fugiat anim Lorem consectetur ad. Consequat et cillum exercitation sint culpa et nulla dolor deserunt. Magna esse non excepteur laboris. Ad est amet commodo laboris consectetur mollit consectetur sit sint cupidatat Lorem aliqua officia sint. Pariatur voluptate amet fugiat excepteur cupidatat laborum excepteur velit fugiat proident ea.\r\n",
+    "registered": "2015-08-29T05:49:27 +05:00",
+    "latitude": -80.01189,
+    "longitude": -134.404496,
+    "tags": [
+      "aute",
+      "nisi",
+      "do",
+      "pariatur",
+      "culpa",
+      "minim",
+      "mollit"
+    ],
+    "friends": [
+      {
+        "id": 0,
+        "name": "Betty Gay"
+      },
+      {
+        "id": 1,
+        "name": "Olive West"
+      },
+      {
+        "id": 2,
+        "name": "Wells Morrison"
+      }
+    ],
+    "greeting": "Hello, Marguerite Sargent! You have 1 unread messages.",
+    "favoriteFruit": "strawberry"
+  },
+  {
+    "_id": "56d34108bcdb91f362e8a67d",
+    "index": 13,
+    "guid": "bceb27e9-d344-4ba2-bd63-5d55ee8e05fc",
+    "isActive": false,
+    "balance": "$1,028.16",
+    "picture": "http://placehold.it/32x32",
+    "age": 40,
+    "eyeColor": "green",
+    "name": "Dionne Dickerson",
+    "gender": "female",
+    "company": "LIQUIDOC",
+    "email": "dionnedickerson@liquidoc.com",
+    "phone": "+1 (838) 484-2368",
+    "address": "460 Vandam Street, Fingerville, Colorado, 4022",
+    "about": "Amet veniam do qui non reprehenderit sunt eu voluptate pariatur do ad occaecat duis commodo. Laborum officia velit labore id anim minim. Cillum fugiat duis eu velit in Lorem exercitation sint esse laboris ut culpa amet eu. Sunt pariatur reprehenderit dolor officia. Occaecat eu elit aliqua amet ullamco occaecat aute ex.\r\n",
+    "registered": "2015-09-12T05:36:24 +05:00",
+    "latitude": -17.652115,
+    "longitude": 5.848784,
+    "tags": [
+      "nostrud",
+      "dolore",
+      "elit",
+      "laborum",
+      "labore",
+      "cillum",
+      "sint"
+    ],
+    "friends": [
+      {
+        "id": 0,
+        "name": "Griffith Herman"
+      },
+      {
+        "id": 1,
+        "name": "Bailey Patrick"
+      },
+      {
+        "id": 2,
+        "name": "Webb Patterson"
+      }
+    ],
+    "greeting": "Hello, Dionne Dickerson! You have 1 unread messages.",
+    "favoriteFruit": "apple"
+  },
+  {
+    "_id": "56d3410883dcb3e4b5cd07db",
+    "index": 14,
+    "guid": "631b6afe-bd80-47be-8596-a8f4d147b02b",
+    "isActive": false,
+    "balance": "$3,488.68",
+    "picture": "http://placehold.it/32x32",
+    "age": 36,
+    "eyeColor": "blue",
+    "name": "Compton Solis",
+    "gender": "male",
+    "company": "XEREX",
+    "email": "comptonsolis@xerex.com",
+    "phone": "+1 (806) 407-3164",
+    "address": "985 Radde Place, Hegins, Illinois, 1536",
+    "about": "Ut elit magna sit reprehenderit qui Lorem. Deserunt pariatur mollit anim voluptate culpa dolore. Amet ea cillum ut ullamco tempor cillum quis amet excepteur aliqua. Anim do non eu cillum cillum veniam nulla sunt in. Velit amet aute consectetur consectetur adipisicing eu ex laboris do nostrud ex nisi dolore.\r\n",
+    "registered": "2015-11-25T06:10:23 +06:00",
+    "latitude": 49.258598,
+    "longitude": 38.808716,
+    "tags": [
+      "Lorem",
+      "veniam",
+      "magna",
+      "ut",
+      "irure",
+      "cillum",
+      "in"
+    ],
+    "friends": [
+      {
+        "id": 0,
+        "name": "Cross Dyer"
+      },
+      {
+        "id": 1,
+        "name": "Mathis Ryan"
+      },
+      {
+        "id": 2,
+        "name": "Bernard Weiss"
+      }
+    ],
+    "greeting": "Hello, Compton Solis! You have 8 unread messages.",
+    "favoriteFruit": "strawberry"
+  }
+]