

{"id":12977,"date":"2021-03-01T07:45:14","date_gmt":"2021-03-01T12:45:14","guid":{"rendered":"https:\/\/rud.is\/b\/?p=12977"},"modified":"2021-03-01T07:45:14","modified_gmt":"2021-03-01T12:45:14","slug":"brimming-with-possibilities-query-zqd-mine-logs-with-zq-from-r","status":"publish","type":"post","link":"https:\/\/rud.is\/b\/2021\/03\/01\/brimming-with-possibilities-query-zqd-mine-logs-with-zq-from-r\/","title":{"rendered":"Brimming With Possibilities: Query zqd &#038; Mine Logs with zq from R"},"content":{"rendered":"<p><a href=\"https:\/\/www.brimsecurity.com\/\">Brim Security<\/a> maintains a free, Electron-based desktop GUI for exploration of PCAPs and select cybersecurity logs:<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/03\/brimr-suricata.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"12978\" data-permalink=\"https:\/\/rud.is\/b\/2021\/03\/01\/brimming-with-possibilities-query-zqd-mine-logs-with-zq-from-r\/brimr-suricata\/\" data-orig-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/03\/brimr-suricata.png?fit=2880%2C1800&amp;ssl=1\" data-orig-size=\"2880,1800\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"brimr-suricata\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/03\/brimr-suricata.png?fit=510%2C319&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/03\/brimr-suricata.png?resize=510%2C319&#038;ssl=1\" alt=\"\" width=\"510\" height=\"319\" class=\"aligncenter size-full wp-image-12978\" srcset=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/03\/brimr-suricata.png?w=2880&amp;ssl=1 2880w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/03\/brimr-suricata.png?resize=300%2C188&amp;ssl=1 300w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/03\/brimr-suricata.png?resize=530%2C331&amp;ssl=1 530w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/03\/brimr-suricata.png?resize=150%2C94&amp;ssl=1 150w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/03\/brimr-suricata.png?resize=768%2C480&amp;ssl=1 768w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/03\/brimr-suricata.png?resize=1536%2C960&amp;ssl=1 1536w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/03\/brimr-suricata.png?resize=2048%2C1280&amp;ssl=1 2048w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/03\/brimr-suricata.png?resize=500%2C313&amp;ssl=1 500w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/03\/brimr-suricata.png?resize=1200%2C750&amp;ssl=1 1200w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/03\/brimr-suricata.png?resize=400%2C250&amp;ssl=1 400w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/03\/brimr-suricata.png?resize=800%2C500&amp;ssl=1 800w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/03\/brimr-suricata.png?resize=200%2C125&amp;ssl=1 200w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/03\/brimr-suricata.png?w=1020&amp;ssl=1 1020w\" sizes=\"auto, (max-width: 510px) 100vw, 510px\" \/><\/a><\/p>\n<p>along with a broad <a href=\"https:\/\/github.com\/brimsec\">ecosystem of tools<\/a> which can be used independently of the GUI.<\/p>\n<p>The standalone or embedded <code>zqd<\/code> server, as well as the <code>zq<\/code> command line utility let analysts run ZQL (a domain-specific query language) queries on cybersecurity data sources.<\/p>\n<p>The Brim team maintains a Python module that is capable of working with the <code>zqd<\/code> HTTP API and my nascent {brimr}<sup><a href=\"https:\/\/git.rud.is\/hrbrmstr\/brimr\">gitea<\/a>|<a href=\"https:\/\/github.com\/hrbrmstr\/brimr\">gh<\/a>|<a href=\"https:\/\/gitlab.com\/hrbrmstr\/brimr\">gl<\/a>|<a href=\"https:\/\/bitbucket.com\/hrbrmstr\/brimr\">bb<\/a><\/sup> R package provides a similar API structure to perform similar operations in R, along with a wrapper for the <code>zq<\/code> commmand line tool.<\/p>\n<h3>PCAPs! In! Spaaaaacce[s]!<\/h3>\n<p>Brim Desktop organizes input sources into something called &#8220;spaces&#8221;. We can check for available spaces with <code>brim_spaces()<\/code>:<\/p>\n<pre><code class=\"language-r\">library(brimr)\nlibrary(tibble)\n\nbrim_spaces()\n##                               id                                                            name\n## 1 sp_1p6pwLgtsESYBTHU9PL9fcl2iBn 2021-02-17-Trickbot-gtag-rob13-infection-in-AD-environment.pcap\n##                                                                                              data_path storage_kind\n## 1 file:\/\/\/Users\/demo\/Library\/Application%20Support\/Brim\/data\/spaces\/sp_1p6pwLgtsESYBTHU9PL9fcl2iBn    filestore\n<\/code><\/pre>\n<p>This single space availble is a sample capture of <a href=\"https:\/\/blog.malwarebytes.com\/detections\/trojan-trickbot\/\">Trickbot<\/a><\/p>\n<p>Let&#8217;s profile the network connections in this capture:<\/p>\n<pre><code class=\"language-r\"># ZQL query to fetch Zeek connection data\nzql1 &lt;- '_path=conn | count() by id.orig_h, id.resp_h, id.resp_p | sort id.orig_h, id.resp_h, id.resp_p'\n\nspace &lt;- \"2021-02-17-Trickbot-gtag-rob13-infection-in-AD-environment.pcap\"\n\nr1 &lt;- brim_search(space, zql1)\n\nr1\n## ZQL query took 0.0000 seconds; 384 records matched; 1,082 records read; 238,052 bytes read\n\n(r1 &lt;- as_tibble(tidy_brim(r1)))\n## # A tibble: 74 x 4\n##    orig_h      resp_h       resp_p count\n##    &lt;chr&gt;       &lt;chr&gt;        &lt;chr&gt;  &lt;int&gt;\n##  1 10.2.17.2   10.2.17.101  49787      1\n##  2 10.2.17.101 3.222.126.94 80         1\n##  3 10.2.17.101 10.2.17.1    445        1\n##  4 10.2.17.101 10.2.17.2    53        97\n##  5 10.2.17.101 10.2.17.2    88        27\n##  6 10.2.17.101 10.2.17.2    123        5\n##  7 10.2.17.101 10.2.17.2    135        8\n##  8 10.2.17.101 10.2.17.2    137        2\n##  9 10.2.17.101 10.2.17.2    138        2\n## 10 10.2.17.101 10.2.17.2    389       37\n## # \u2026 with 64 more rows\n<\/code><\/pre>\n<p>Brim auto-processed the PCAP into <a href=\"https:\/\/zeek.org\/\">Zeek<\/a> log format and <code>_path=conn<\/code> in query string indicates that&#8217;s where we&#8217;re going to perform further data operations (the queries are structured a bit like <a href=\"https:\/\/stedolan.github.io\/jq\/\"><code>jq<\/code><\/a> filters). We then ask Brim\/<code>zqd<\/code> to summarize and sort source IP, destination IP, and port counts. {brimr} sends this query over to the server. The raw response is a custom data structure that we can turn into a tidy data frame via <code>tidy_brim()<\/code>.<\/p>\n<p>We can do something similar with the Suricata data that Brim also auto-processes for us:<\/p>\n<pre><code class=\"language-r\"># Z query to fetch Suricata alerts including the count of alerts per source:destination \nzql2 &lt;- \"event_type=alert | count() by src_ip, dest_ip, dest_port, alert.severity, alert.signature | sort src_ip, dest_ip, dest_port, alert.severity, alert.signature\"\n\nr2 &lt;- brim_search(space, zql2)\n\nr2\n## ZQL query took 0.0000 seconds; 47 records matched; 870 records read; 238,660 bytes read\n\n(r2 &lt;- (as_tibble(tidy_brim(r2))))\n## # A tibble: 35 x 6\n##    src_ip     dest_ip    dest_port severity signature                                                              count\n##    &lt;chr&gt;      &lt;chr&gt;          &lt;int&gt;    &lt;int&gt; &lt;chr&gt;                                                                  &lt;int&gt;\n##  1 10.2.17.2  10.2.17.1\u2026     49674        3 SURICATA Applayer Detect protocol only one direction                       1\n##  2 10.2.17.2  10.2.17.1\u2026     49680        3 SURICATA Applayer Detect protocol only one direction                       1\n##  3 10.2.17.2  10.2.17.1\u2026     49687        3 SURICATA Applayer Detect protocol only one direction                       1\n##  4 10.2.17.2  10.2.17.1\u2026     49704        3 SURICATA Applayer Detect protocol only one direction                       1\n##  5 10.2.17.2  10.2.17.1\u2026     49709        3 SURICATA Applayer Detect protocol only one direction                       1\n##  6 10.2.17.2  10.2.17.1\u2026     49721        3 SURICATA Applayer Detect protocol only one direction                       1\n##  7 10.2.17.2  10.2.17.1\u2026     50126        3 SURICATA Applayer Detect protocol only one direction                       1\n##  8 10.2.17.1\u2026 3.222.126\u2026        80        2 ET POLICY curl User-Agent Outbound                                         1\n##  9 10.2.17.1\u2026 36.95.27.\u2026       443        1 ET HUNTING Suspicious POST with Common Windows Process Names - Possib\u2026     1\n## 10 10.2.17.1\u2026 36.95.27.\u2026       443        1 ET MALWARE Win32\/Trickbot Data Exfiltration                                1\n## # \u2026 with 25 more rows\n<\/code><\/pre>\n<p>Finally, for this toy example, we&#8217;ll also generate a visual overview of these connections:<\/p>\n<pre><code class=\"language-r\">library(igraph)\nlibrary(ggraph)\nlibrary(tidyverse)\n\ngdf &lt;- count(r1, orig_h, resp_h, wt=count)\n\ncount(gdf, node = resp_h, wt=n, name = \"in_degree\") %&gt;% \n  full_join(\n    count(gdf, node = orig_h, name = \"out_degree\")\n  ) %&gt;% \n  mutate_at(\n    vars(in_degree, out_degree),\n    replace_na, 1\n  ) %&gt;% \n  arrange(in_degree) -&gt; vdf\n\ng &lt;- graph_from_data_frame(gdf, vertices = vdf)\n\nggraph(g, layout = \"linear\") +\n  geom_node_point(\n    aes(size = in_degree), shape = 21\n  ) +\n  geom_edge_arc(\n    width = 0.125, \n    arrow = arrow(\n      length = unit(5, \"pt\"),\n      type = \"closed\"\n    )\n  )\n<\/code><\/pre>\n<p><a href=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/03\/brimr-graph.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"12980\" data-permalink=\"https:\/\/rud.is\/b\/2021\/03\/01\/brimming-with-possibilities-query-zqd-mine-logs-with-zq-from-r\/brimr-graph\/\" data-orig-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/03\/brimr-graph.png?fit=1728%2C960&amp;ssl=1\" data-orig-size=\"1728,960\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"brimr-graph\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/03\/brimr-graph.png?fit=510%2C283&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/03\/brimr-graph.png?resize=510%2C283&#038;ssl=1\" alt=\"\" width=\"510\" height=\"283\" class=\"aligncenter size-full wp-image-12980\" srcset=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/03\/brimr-graph.png?w=1728&amp;ssl=1 1728w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/03\/brimr-graph.png?resize=300%2C167&amp;ssl=1 300w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/03\/brimr-graph.png?resize=530%2C294&amp;ssl=1 530w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/03\/brimr-graph.png?resize=150%2C83&amp;ssl=1 150w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/03\/brimr-graph.png?resize=768%2C427&amp;ssl=1 768w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/03\/brimr-graph.png?resize=1536%2C853&amp;ssl=1 1536w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/03\/brimr-graph.png?resize=500%2C278&amp;ssl=1 500w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/03\/brimr-graph.png?resize=1200%2C667&amp;ssl=1 1200w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/03\/brimr-graph.png?resize=400%2C222&amp;ssl=1 400w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/03\/brimr-graph.png?resize=800%2C444&amp;ssl=1 800w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/03\/brimr-graph.png?resize=200%2C111&amp;ssl=1 200w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/03\/brimr-graph.png?w=1020&amp;ssl=1 1020w\" sizes=\"auto, (max-width: 510px) 100vw, 510px\" \/><\/a><\/p>\n<p>We can also process log files directly (i.e. without any server) with <code>zq_cmd()<\/code>:<\/p>\n<pre><code class=\"language-r\">zq_cmd(\n  c(\n    '\"* | cut ts,id.orig_h,id.orig_p\"', # note the quotes\n    system.file(\"logs\", \"conn.log.gz\", package = \"brimr\")\n   )\n )\n##           id.orig_h id.orig_p                          ts\n##   1:  10.164.94.120     39681 2018-03-24T17:15:21.255387Z\n##   2:    10.47.25.80     50817 2018-03-24T17:15:21.411148Z\n##   3:    10.47.25.80     50817 2018-03-24T17:15:21.926018Z\n##   4:    10.47.25.80     50813 2018-03-24T17:15:22.690601Z\n##   5:    10.47.25.80     50813 2018-03-24T17:15:23.205187Z\n##  ---                                                     \n## 988: 10.174.251.215     33003 2018-03-24T17:15:21.429238Z\n## 989: 10.174.251.215     33003 2018-03-24T17:15:21.429315Z\n## 990: 10.174.251.215     33003 2018-03-24T17:15:21.429479Z\n## 991:  10.164.94.120     38265 2018-03-24T17:15:21.427375Z\n## 992: 10.174.251.215     33003 2018-03-24T17:15:21.433306Z\n<\/code><\/pre>\n<h3>FIN<\/h3>\n<p>This package is less than 24 hrs old (as of the original blog post date) and there are still a few bits missing, which means y&#8217;all have the ability to guide the direction it heads in. So kick the tyres and interact where you&#8217;re most comfortable.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Brim Security maintains a free, Electron-based desktop GUI for exploration of PCAPs and select cybersecurity logs: along with a broad ecosystem of tools which can be used independently of the GUI. The standalone or embedded zqd server, as well as the zq command line utility let analysts run ZQL (a domain-specific query language) queries on [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":12980,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":3,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":""},"categories":[681,91],"tags":[],"class_list":["post-12977","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cybersecurity","category-r"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Brimming With Possibilities: Query zqd &amp; Mine Logs with zq from R - rud.is<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/rud.is\/b\/2021\/03\/01\/brimming-with-possibilities-query-zqd-mine-logs-with-zq-from-r\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Brimming With Possibilities: Query zqd &amp; Mine Logs with zq from R - rud.is\" \/>\n<meta property=\"og:description\" content=\"Brim Security maintains a free, Electron-based desktop GUI for exploration of PCAPs and select cybersecurity logs: along with a broad ecosystem of tools which can be used independently of the GUI. The standalone or embedded zqd server, as well as the zq command line utility let analysts run ZQL (a domain-specific query language) queries on [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/rud.is\/b\/2021\/03\/01\/brimming-with-possibilities-query-zqd-mine-logs-with-zq-from-r\/\" \/>\n<meta property=\"og:site_name\" content=\"rud.is\" \/>\n<meta property=\"article:published_time\" content=\"2021-03-01T12:45:14+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/03\/brimr-graph.png?fit=1728%2C960&ssl=1\" \/>\n\t<meta property=\"og:image:width\" content=\"1728\" \/>\n\t<meta property=\"og:image:height\" content=\"960\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"hrbrmstr\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"hrbrmstr\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2021\\\/03\\\/01\\\/brimming-with-possibilities-query-zqd-mine-logs-with-zq-from-r\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2021\\\/03\\\/01\\\/brimming-with-possibilities-query-zqd-mine-logs-with-zq-from-r\\\/\"},\"author\":{\"name\":\"hrbrmstr\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#\\\/schema\\\/person\\\/d7cb7487ab0527447f7fda5c423ff886\"},\"headline\":\"Brimming With Possibilities: Query zqd &#038; Mine Logs with zq from R\",\"datePublished\":\"2021-03-01T12:45:14+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2021\\\/03\\\/01\\\/brimming-with-possibilities-query-zqd-mine-logs-with-zq-from-r\\\/\"},\"wordCount\":316,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#\\\/schema\\\/person\\\/d7cb7487ab0527447f7fda5c423ff886\"},\"image\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2021\\\/03\\\/01\\\/brimming-with-possibilities-query-zqd-mine-logs-with-zq-from-r\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2021\\\/03\\\/brimr-graph.png?fit=1728%2C960&ssl=1\",\"articleSection\":[\"Cybersecurity\",\"R\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/rud.is\\\/b\\\/2021\\\/03\\\/01\\\/brimming-with-possibilities-query-zqd-mine-logs-with-zq-from-r\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2021\\\/03\\\/01\\\/brimming-with-possibilities-query-zqd-mine-logs-with-zq-from-r\\\/\",\"url\":\"https:\\\/\\\/rud.is\\\/b\\\/2021\\\/03\\\/01\\\/brimming-with-possibilities-query-zqd-mine-logs-with-zq-from-r\\\/\",\"name\":\"Brimming With Possibilities: Query zqd & Mine Logs with zq from R - rud.is\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2021\\\/03\\\/01\\\/brimming-with-possibilities-query-zqd-mine-logs-with-zq-from-r\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2021\\\/03\\\/01\\\/brimming-with-possibilities-query-zqd-mine-logs-with-zq-from-r\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2021\\\/03\\\/brimr-graph.png?fit=1728%2C960&ssl=1\",\"datePublished\":\"2021-03-01T12:45:14+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2021\\\/03\\\/01\\\/brimming-with-possibilities-query-zqd-mine-logs-with-zq-from-r\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/rud.is\\\/b\\\/2021\\\/03\\\/01\\\/brimming-with-possibilities-query-zqd-mine-logs-with-zq-from-r\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2021\\\/03\\\/01\\\/brimming-with-possibilities-query-zqd-mine-logs-with-zq-from-r\\\/#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2021\\\/03\\\/brimr-graph.png?fit=1728%2C960&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2021\\\/03\\\/brimr-graph.png?fit=1728%2C960&ssl=1\",\"width\":1728,\"height\":960},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2021\\\/03\\\/01\\\/brimming-with-possibilities-query-zqd-mine-logs-with-zq-from-r\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/rud.is\\\/b\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Brimming With Possibilities: Query zqd &#038; Mine Logs with zq from R\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#website\",\"url\":\"https:\\\/\\\/rud.is\\\/b\\\/\",\"name\":\"rud.is\",\"description\":\"&quot;In God we trust. All others must bring data&quot;\",\"publisher\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#\\\/schema\\\/person\\\/d7cb7487ab0527447f7fda5c423ff886\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/rud.is\\\/b\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#\\\/schema\\\/person\\\/d7cb7487ab0527447f7fda5c423ff886\",\"name\":\"hrbrmstr\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/ukr-shield.png?fit=460%2C460&ssl=1\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/ukr-shield.png?fit=460%2C460&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/ukr-shield.png?fit=460%2C460&ssl=1\",\"width\":460,\"height\":460,\"caption\":\"hrbrmstr\"},\"logo\":{\"@id\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/ukr-shield.png?fit=460%2C460&ssl=1\"},\"description\":\"Don't look at me\u2026I do what he does \u2014 just slower. #rstats avuncular \u2022 ?Resistance Fighter \u2022 Cook \u2022 Christian \u2022 [Master] Chef des Donn\u00e9es de S\u00e9curit\u00e9 @ @rapid7\",\"sameAs\":[\"http:\\\/\\\/rud.is\"],\"url\":\"https:\\\/\\\/rud.is\\\/b\\\/author\\\/hrbrmstr\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Brimming With Possibilities: Query zqd & Mine Logs with zq from R - rud.is","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/rud.is\/b\/2021\/03\/01\/brimming-with-possibilities-query-zqd-mine-logs-with-zq-from-r\/","og_locale":"en_US","og_type":"article","og_title":"Brimming With Possibilities: Query zqd & Mine Logs with zq from R - rud.is","og_description":"Brim Security maintains a free, Electron-based desktop GUI for exploration of PCAPs and select cybersecurity logs: along with a broad ecosystem of tools which can be used independently of the GUI. The standalone or embedded zqd server, as well as the zq command line utility let analysts run ZQL (a domain-specific query language) queries on [&hellip;]","og_url":"https:\/\/rud.is\/b\/2021\/03\/01\/brimming-with-possibilities-query-zqd-mine-logs-with-zq-from-r\/","og_site_name":"rud.is","article_published_time":"2021-03-01T12:45:14+00:00","og_image":[{"width":1728,"height":960,"url":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/03\/brimr-graph.png?fit=1728%2C960&ssl=1","type":"image\/png"}],"author":"hrbrmstr","twitter_card":"summary_large_image","twitter_misc":{"Written by":"hrbrmstr","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/rud.is\/b\/2021\/03\/01\/brimming-with-possibilities-query-zqd-mine-logs-with-zq-from-r\/#article","isPartOf":{"@id":"https:\/\/rud.is\/b\/2021\/03\/01\/brimming-with-possibilities-query-zqd-mine-logs-with-zq-from-r\/"},"author":{"name":"hrbrmstr","@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886"},"headline":"Brimming With Possibilities: Query zqd &#038; Mine Logs with zq from R","datePublished":"2021-03-01T12:45:14+00:00","mainEntityOfPage":{"@id":"https:\/\/rud.is\/b\/2021\/03\/01\/brimming-with-possibilities-query-zqd-mine-logs-with-zq-from-r\/"},"wordCount":316,"commentCount":2,"publisher":{"@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886"},"image":{"@id":"https:\/\/rud.is\/b\/2021\/03\/01\/brimming-with-possibilities-query-zqd-mine-logs-with-zq-from-r\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/03\/brimr-graph.png?fit=1728%2C960&ssl=1","articleSection":["Cybersecurity","R"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/rud.is\/b\/2021\/03\/01\/brimming-with-possibilities-query-zqd-mine-logs-with-zq-from-r\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/rud.is\/b\/2021\/03\/01\/brimming-with-possibilities-query-zqd-mine-logs-with-zq-from-r\/","url":"https:\/\/rud.is\/b\/2021\/03\/01\/brimming-with-possibilities-query-zqd-mine-logs-with-zq-from-r\/","name":"Brimming With Possibilities: Query zqd & Mine Logs with zq from R - rud.is","isPartOf":{"@id":"https:\/\/rud.is\/b\/#website"},"primaryImageOfPage":{"@id":"https:\/\/rud.is\/b\/2021\/03\/01\/brimming-with-possibilities-query-zqd-mine-logs-with-zq-from-r\/#primaryimage"},"image":{"@id":"https:\/\/rud.is\/b\/2021\/03\/01\/brimming-with-possibilities-query-zqd-mine-logs-with-zq-from-r\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/03\/brimr-graph.png?fit=1728%2C960&ssl=1","datePublished":"2021-03-01T12:45:14+00:00","breadcrumb":{"@id":"https:\/\/rud.is\/b\/2021\/03\/01\/brimming-with-possibilities-query-zqd-mine-logs-with-zq-from-r\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/rud.is\/b\/2021\/03\/01\/brimming-with-possibilities-query-zqd-mine-logs-with-zq-from-r\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/rud.is\/b\/2021\/03\/01\/brimming-with-possibilities-query-zqd-mine-logs-with-zq-from-r\/#primaryimage","url":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/03\/brimr-graph.png?fit=1728%2C960&ssl=1","contentUrl":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/03\/brimr-graph.png?fit=1728%2C960&ssl=1","width":1728,"height":960},{"@type":"BreadcrumbList","@id":"https:\/\/rud.is\/b\/2021\/03\/01\/brimming-with-possibilities-query-zqd-mine-logs-with-zq-from-r\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/rud.is\/b\/"},{"@type":"ListItem","position":2,"name":"Brimming With Possibilities: Query zqd &#038; Mine Logs with zq from R"}]},{"@type":"WebSite","@id":"https:\/\/rud.is\/b\/#website","url":"https:\/\/rud.is\/b\/","name":"rud.is","description":"&quot;In God we trust. All others must bring data&quot;","publisher":{"@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/rud.is\/b\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886","name":"hrbrmstr","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2023\/10\/ukr-shield.png?fit=460%2C460&ssl=1","url":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2023\/10\/ukr-shield.png?fit=460%2C460&ssl=1","contentUrl":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2023\/10\/ukr-shield.png?fit=460%2C460&ssl=1","width":460,"height":460,"caption":"hrbrmstr"},"logo":{"@id":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2023\/10\/ukr-shield.png?fit=460%2C460&ssl=1"},"description":"Don't look at me\u2026I do what he does \u2014 just slower. #rstats avuncular \u2022 ?Resistance Fighter \u2022 Cook \u2022 Christian \u2022 [Master] Chef des Donn\u00e9es de S\u00e9curit\u00e9 @ @rapid7","sameAs":["http:\/\/rud.is"],"url":"https:\/\/rud.is\/b\/author\/hrbrmstr\/"}]}},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2021\/03\/brimr-graph.png?fit=1728%2C960&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p23idr-3nj","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":13120,"url":"https:\/\/rud.is\/b\/2021\/07\/20\/packet-maze-solving-a-cyberdefenders-pcap-puzzle-with-r-zeek-and-tshark\/","url_meta":{"origin":12977,"position":0},"title":"Packet Maze: Solving a CyberDefenders PCAP Puzzle with R, Zeek, and tshark","author":"hrbrmstr","date":"2021-07-20","format":false,"excerpt":"It was a rainy weekend in southern Maine and I really didn't feel like doing chores, so I was skimming through RSS feeds and noticed a link to a PacketMaze challenge in the latest This Week In 4n6. Since it's also been a while since I've done any serious content\u2026","rel":"","context":"In &quot;Cybersecurity&quot;","block_context":{"text":"Cybersecurity","link":"https:\/\/rud.is\/b\/category\/cybersecurity\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":8230,"url":"https:\/\/rud.is\/b\/2018\/02\/16\/pym-js-library-vulnerability-in-widgetframe-package\/","url_meta":{"origin":12977,"position":1},"title":"Pym.js Library Vulnerability in widgetframe Package","author":"hrbrmstr","date":"2018-02-16","format":false,"excerpt":"What's Up? The NPR Visuals Team created and maintains a javascript library that makes it super easy to embed iframes on web pages and have said documents still be responsive. The widgetframe R htmlwidget uses pym.js to bring this (much needed) functionality into widgets and (eventually) shiny apps. NPR reported\u2026","rel":"","context":"In &quot;Cybersecurity&quot;","block_context":{"text":"Cybersecurity","link":"https:\/\/rud.is\/b\/category\/cybersecurity\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":24954,"url":"https:\/\/rud.is\/b\/2025\/04\/17\/trumps-retaliation-against-chris-krebs-and-the-cybersecurity-industrys-deafening-silence\/","url_meta":{"origin":12977,"position":2},"title":"Trump\u2019s Retaliation Against Chris Krebs \u2014 and the Cybersecurity Industry\u2019s Deafening Silence","author":"hrbrmstr","date":"2025-04-17","format":false,"excerpt":"Chris Krebs, the former director of the Cybersecurity and Infrastructure Security Agency (CISA), was fired by Donald Trump in 2020 for publicly affirming that the presidential election was secure and free from widespread fraud. Fast-forward to April 2025: Trump, now back in the White House, issued an executive order revoking\u2026","rel":"","context":"In &quot;Commentary&quot;","block_context":{"text":"Commentary","link":"https:\/\/rud.is\/b\/category\/commentary\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2025\/04\/kalea-morgan-zFPTvo0aZ0g-unsplash.jpg?fit=1129%2C1200&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2025\/04\/kalea-morgan-zFPTvo0aZ0g-unsplash.jpg?fit=1129%2C1200&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2025\/04\/kalea-morgan-zFPTvo0aZ0g-unsplash.jpg?fit=1129%2C1200&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2025\/04\/kalea-morgan-zFPTvo0aZ0g-unsplash.jpg?fit=1129%2C1200&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2025\/04\/kalea-morgan-zFPTvo0aZ0g-unsplash.jpg?fit=1129%2C1200&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":25134,"url":"https:\/\/rud.is\/b\/2025\/04\/29\/rsac-2025-sets-a-dangerous-precedent-for-cybersecurity-leadership\/","url_meta":{"origin":12977,"position":3},"title":"RSAC 2025 Sets A Dangerous Precedent for Cybersecurity Leadership","author":"hrbrmstr","date":"2025-04-29","format":false,"excerpt":"(I posted this on LI, but I like to own my content, so am also posting here.) The cybersecurity community deserves better than what we're witnessing at RSAC 2025, today. While Kristi Noem delivers today's keynote, the absence of traditional cybersecurity leaders from agencies like NSA and CISA speaks volumes\u2026","rel":"","context":"In &quot;Commentary&quot;","block_context":{"text":"Commentary","link":"https:\/\/rud.is\/b\/category\/commentary\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":4852,"url":"https:\/\/rud.is\/b\/2017\/01\/08\/2017-01-authored-package-updates\/","url_meta":{"origin":12977,"position":4},"title":"2017-01 Authored Package Updates","author":"hrbrmstr","date":"2017-01-08","format":false,"excerpt":"The rest of the month is going to be super-hectic and it's unlikely I'll be able to do any more to help the push to CRAN 10K, so here's a breakdown of CRAN and GitHub new packages & package updates that I felt were worth raising awareness on: epidata I\u2026","rel":"","context":"In &quot;dplyr&quot;","block_context":{"text":"dplyr","link":"https:\/\/rud.is\/b\/category\/dplyr\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2017\/01\/epi2.png?fit=982%2C1200&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2017\/01\/epi2.png?fit=982%2C1200&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2017\/01\/epi2.png?fit=982%2C1200&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2017\/01\/epi2.png?fit=982%2C1200&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":3775,"url":"https:\/\/rud.is\/b\/2015\/11\/08\/visualizing_survey_data\/","url_meta":{"origin":12977,"position":5},"title":"Visualizing Survey Data : Comparison Between Observations","author":"hrbrmstr","date":"2015-11-08","format":false,"excerpt":"Cybersecurity is a domain that really likes surveys, or at the very least it has many folks within it that like to conduct and report on surveys. One recent survey on threat intelligence is in it's second year, so it sets about comparing answers across years. Rather than go into\u2026","rel":"","context":"In &quot;Cybersecurity&quot;","block_context":{"text":"Cybersecurity","link":"https:\/\/rud.is\/b\/category\/cybersecurity\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/11\/Visualizing_Survey_Data___Comparison_Between_Observations.png?fit=1200%2C721&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/11\/Visualizing_Survey_Data___Comparison_Between_Observations.png?fit=1200%2C721&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/11\/Visualizing_Survey_Data___Comparison_Between_Observations.png?fit=1200%2C721&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/11\/Visualizing_Survey_Data___Comparison_Between_Observations.png?fit=1200%2C721&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2015\/11\/Visualizing_Survey_Data___Comparison_Between_Observations.png?fit=1200%2C721&ssl=1&resize=1050%2C600 3x"},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/posts\/12977","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/comments?post=12977"}],"version-history":[{"count":0,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/posts\/12977\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/media\/12980"}],"wp:attachment":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/media?parent=12977"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/categories?post=12977"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/tags?post=12977"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}