<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Break up multi line event in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Break-up-multi-line-event/m-p/407372#M72228</link>
    <description>&lt;P&gt;Frank - Arg, sorry I didn't give you the _raw log. Here is the _raw log below, would what you gave me work for the _raw log? Attached is an image of the _raw log tabled out which is what I gave you in the first post. (I manually changed the data (i.e. IP's, acct #'s, etc, to hide secure info)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{"account_id": "2345625234", "vpc_id": "vpc-xxxxxx", "id": "sg-xxxxxx", "rules": [{"from_port": null, "groups": "\n                    ", "to_port": null, "grants": [{"owner_id": "323256661429", "group_id": "sg-xxxxx", "cidr_ip": null, "name": null}, {"owner_id": "253452345", "group_id": "sg-xxxxxx", "cidr_ip": null, "name": null}], "ipRanges": "", "ip_protocol": "-1"}, {"from_port": "22", "groups": "", "to_port": "22", "grants": [{"owner_id": null, "group_id": null, "cidr_ip": "11.233.34.0/24", "name": null}], "ipRanges": "\n                    ", "ip_protocol": "tcp"}, {"from_port": "443", "groups": "\n                    ", "to_port": "443", "grants": [{"owner_id": "2345432223", "group_id": "sg-770f1213", "cidr_ip": null, "name": null}, {"owner_id": null, "group_id": null, "cidr_ip": "12.45.50.0/24", "name": null}, {"owner_id": null, "group_id": null, "cidr_ip": "0.0.0.0/0", "name": null}], "ipRanges": "\n                    ", "ip_protocol": "tcp"}], "tags": {"aws:cloudformation:stack-id": "arn:aws-us:cloudformation:xxxx", "aws:cloudformation:stack-name": "xxx", "aws:cloudformation:logical-xx": "rSecurityGroup"}, "instances": [{"id": "i-0fqjwoi34f"}], "name": "SG-seccenter", "rules_egress": [{"from_port": null, "groups": "", "to_port": null, "grants": [{"owner_id": null, "group_id": null, "cidr_ip": "0.0.0.0/0", "name": null}], "ipRanges": "\n                    ", "ip_protocol": "-1"}], "region": "us-gov-west-1", "owner_id": "3234635623", "description": "SG for seccenter"}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/6609iFD91E3C1ABE34A98/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 26 Feb 2019 14:06:45 GMT</pubDate>
    <dc:creator>JPaule</dc:creator>
    <dc:date>2019-02-26T14:06:45Z</dc:date>
    <item>
      <title>Break up multi line event</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Break-up-multi-line-event/m-p/407369#M72225</link>
      <description>&lt;P&gt;I'm trying to query for which ports are open on IP ranges, although the data has multiline information. Below is an example of one event. So if I wanted to query what is open to 0.0.0.0/0, right now my query returns 22, 443, 1515 because of how the event is structured. &lt;/P&gt;

&lt;P&gt;How can I break up this event so I get the correct result that 22 is the only one open to 0.0.0.0/0. &lt;/P&gt;

&lt;P&gt;Also, how can I show 443 has the 2 IP's open 11.11.55.0/24 and 12.35.12.0/26?&lt;/P&gt;

&lt;P&gt;(Goes without saying but the data/IP's below are made up) &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Acct               Port       CIDR
77812              22        0.0.0.0/0
                   443       11.11.55.0/24
                             12.35.12.0/26
                   1515      11.0.0.0/10
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 25 Feb 2019 16:23:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Break-up-multi-line-event/m-p/407369#M72225</guid>
      <dc:creator>JPaule</dc:creator>
      <dc:date>2019-02-25T16:23:37Z</dc:date>
    </item>
    <item>
      <title>Re: Break up multi line event</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Break-up-multi-line-event/m-p/407370#M72226</link>
      <description>&lt;P&gt;Is that what your raw data looks like, or is this a representation of it after field extraction and formatting it as a table with certain search commands?&lt;/P&gt;

&lt;P&gt;In the latter case, can you please share also the raw data and the search you had to come to this table?&lt;/P&gt;</description>
      <pubDate>Tue, 26 Feb 2019 10:55:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Break-up-multi-line-event/m-p/407370#M72226</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2019-02-26T10:55:31Z</dc:date>
    </item>
    <item>
      <title>Re: Break up multi line event</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Break-up-multi-line-event/m-p/407371#M72227</link>
      <description>&lt;P&gt;Edit: wrong assumption that the tabular data was the raw data.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Feb 2019 12:04:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Break-up-multi-line-event/m-p/407371#M72227</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2019-02-26T12:04:48Z</dc:date>
    </item>
    <item>
      <title>Re: Break up multi line event</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Break-up-multi-line-event/m-p/407372#M72228</link>
      <description>&lt;P&gt;Frank - Arg, sorry I didn't give you the _raw log. Here is the _raw log below, would what you gave me work for the _raw log? Attached is an image of the _raw log tabled out which is what I gave you in the first post. (I manually changed the data (i.e. IP's, acct #'s, etc, to hide secure info)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{"account_id": "2345625234", "vpc_id": "vpc-xxxxxx", "id": "sg-xxxxxx", "rules": [{"from_port": null, "groups": "\n                    ", "to_port": null, "grants": [{"owner_id": "323256661429", "group_id": "sg-xxxxx", "cidr_ip": null, "name": null}, {"owner_id": "253452345", "group_id": "sg-xxxxxx", "cidr_ip": null, "name": null}], "ipRanges": "", "ip_protocol": "-1"}, {"from_port": "22", "groups": "", "to_port": "22", "grants": [{"owner_id": null, "group_id": null, "cidr_ip": "11.233.34.0/24", "name": null}], "ipRanges": "\n                    ", "ip_protocol": "tcp"}, {"from_port": "443", "groups": "\n                    ", "to_port": "443", "grants": [{"owner_id": "2345432223", "group_id": "sg-770f1213", "cidr_ip": null, "name": null}, {"owner_id": null, "group_id": null, "cidr_ip": "12.45.50.0/24", "name": null}, {"owner_id": null, "group_id": null, "cidr_ip": "0.0.0.0/0", "name": null}], "ipRanges": "\n                    ", "ip_protocol": "tcp"}], "tags": {"aws:cloudformation:stack-id": "arn:aws-us:cloudformation:xxxx", "aws:cloudformation:stack-name": "xxx", "aws:cloudformation:logical-xx": "rSecurityGroup"}, "instances": [{"id": "i-0fqjwoi34f"}], "name": "SG-seccenter", "rules_egress": [{"from_port": null, "groups": "", "to_port": null, "grants": [{"owner_id": null, "group_id": null, "cidr_ip": "0.0.0.0/0", "name": null}], "ipRanges": "\n                    ", "ip_protocol": "-1"}], "region": "us-gov-west-1", "owner_id": "3234635623", "description": "SG for seccenter"}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/6609iFD91E3C1ABE34A98/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Feb 2019 14:06:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Break-up-multi-line-event/m-p/407372#M72228</guid>
      <dc:creator>JPaule</dc:creator>
      <dc:date>2019-02-26T14:06:45Z</dc:date>
    </item>
    <item>
      <title>Re: Break up multi line event</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Break-up-multi-line-event/m-p/407373#M72229</link>
      <description>&lt;P&gt;I replied below, but shows up as an answer. I'm somewhat new to using this forum!&lt;/P&gt;</description>
      <pubDate>Tue, 26 Feb 2019 18:34:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Break-up-multi-line-event/m-p/407373#M72229</guid>
      <dc:creator>JPaule</dc:creator>
      <dc:date>2019-02-26T18:34:37Z</dc:date>
    </item>
    <item>
      <title>Re: Break up multi line event</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Break-up-multi-line-event/m-p/407374#M72230</link>
      <description>&lt;P&gt;Ok, so your raw data is actually JSON. In that case, you can use several iterations of spath and mvexpand to pull out the rules, split those, pull out the port and ranges and split those.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|  makeresults
|  eval _raw="{\"account_id\": \"2345625234\", \"vpc_id\": \"vpc-xxxxxx\", \"id\": \"sg-xxxxxx\", \"rules\": [{\"from_port\": null, \"groups\": \"\n                    \", \"to_port\": null, \"grants\": [{\"owner_id\": \"323256661429\", \"group_id\": \"sg-xxxxx\", \"cidr_ip\": null, \"name\": null}, {\"owner_id\": \"253452345\", \"group_id\": \"sg-xxxxxx\", \"cidr_ip\": null, \"name\": null}], \"ipRanges\": \"\", \"ip_protocol\": \"-1\"}, {\"from_port\": \"22\", \"groups\": \"\", \"to_port\": \"22\", \"grants\": [{\"owner_id\": null, \"group_id\": null, \"cidr_ip\": \"11.233.34.0/24\", \"name\": null}], \"ipRanges\": \"\n                    \", \"ip_protocol\": \"tcp\"}, {\"from_port\": \"443\", \"groups\": \"\n                    \", \"to_port\": \"443\", \"grants\": [{\"owner_id\": \"2345432223\", \"group_id\": \"sg-770f1213\", \"cidr_ip\": null, \"name\": null}, {\"owner_id\": null, \"group_id\": null, \"cidr_ip\": \"12.45.50.0/24\", \"name\": null}, {\"owner_id\": null, \"group_id\": null, \"cidr_ip\": \"0.0.0.0/0\", \"name\": null}], \"ipRanges\": \"\n                    \", \"ip_protocol\": \"tcp\"}], \"tags\": {\"aws:cloudformation:stack-id\": \"arn:aws-us:cloudformation:xxxx\", \"aws:cloudformation:stack-name\": \"xxx\", \"aws:cloudformation:logical-xx\": \"rSecurityGroup\"}, \"instances\": [{\"id\": \"i-0fqjwoi34f\"}], \"name\": \"SG-seccenter\", \"rules_egress\": [{\"from_port\": null, \"groups\": \"\", \"to_port\": null, \"grants\": [{\"owner_id\": null, \"group_id\": null, \"cidr_ip\": \"0.0.0.0/0\", \"name\": null}], \"ipRanges\": \"\n                    \", \"ip_protocol\": \"-1\"}], \"region\": \"us-gov-west-1\", \"owner_id\": \"3234635623\", \"description\": \"SG for seccenter\"}"
|  spath input=_raw path=rules{} output=rules
|  table rules
|  mvexpand rules
|  spath input=rules path=from_port output=port
|  spath input=rules path=grants{} output=grants
|  mvexpand grants
|  table grants port
|  spath input=grants path=cidr_ip output=cidr
|  table port cidr
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 27 Feb 2019 08:15:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Break-up-multi-line-event/m-p/407374#M72230</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2019-02-27T08:15:38Z</dc:date>
    </item>
    <item>
      <title>Re: Break up multi line event</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Break-up-multi-line-event/m-p/407375#M72231</link>
      <description>&lt;P&gt;Awesome, this was a huge help!&lt;/P&gt;</description>
      <pubDate>Wed, 27 Feb 2019 14:14:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Break-up-multi-line-event/m-p/407375#M72231</guid>
      <dc:creator>JPaule</dc:creator>
      <dc:date>2019-02-27T14:14:28Z</dc:date>
    </item>
    <item>
      <title>Re: Break up multi line event</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Break-up-multi-line-event/m-p/407376#M72232</link>
      <description>&lt;P&gt;Sorry, one last question. How do I associate port cidr with account_id? When I table it account_id is blank.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:30:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Break-up-multi-line-event/m-p/407376#M72232</guid>
      <dc:creator>JPaule</dc:creator>
      <dc:date>2020-09-29T23:30:35Z</dc:date>
    </item>
    <item>
      <title>Re: Break up multi line event</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Break-up-multi-line-event/m-p/407377#M72233</link>
      <description>&lt;P&gt;Assuming that field is already extracted: make sure to include in all the table commands (or get rid of the intermediate table commands, those were mostly there for my own use to step by step build up the query).&lt;/P&gt;</description>
      <pubDate>Wed, 27 Feb 2019 15:29:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Break-up-multi-line-event/m-p/407377#M72233</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2019-02-27T15:29:40Z</dc:date>
    </item>
  </channel>
</rss>

