<?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: How to break a json log into multiple events in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-break-a-json-log-into-multiple-events/m-p/570002#M101045</link>
    <description>&lt;P&gt;I want to break the json at indextime because mvexpand command is ressource consuming.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want&amp;nbsp; to separate the json in order to have 1 braces by event :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;One event :&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;{ "Version": false, "PlatformName": "Amazon Linux", "ComputerName": "ip-10-170-216-17.eu-east-1.compute.internal" }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;another event&lt;/STRONG&gt; :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;{ "PlatformType": "Linux", "IPAddress": "10.170.216.18", "AssociationOverview": { "DetailedStatus": "Failed", "InstanceAssociationStatusAggregatedCount": { "Failed": 1, "Success": 1 } }, "AssociationStatus": "Failed", "PlatformVersion": "2", "ComputerName": "ip-10-170-216-18.eu-east-1.compute.internal", "InstanceId": "i-00000000001", "PlatformName": "Amazon Linux" }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Wherever there is this :&amp;nbsp;}, {&amp;nbsp; split the json by using setting in props.conf&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 07 Oct 2021 07:59:31 GMT</pubDate>
    <dc:creator>mah</dc:creator>
    <dc:date>2021-10-07T07:59:31Z</dc:date>
    <item>
      <title>How to break a json log into multiple events</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-break-a-json-log-into-multiple-events/m-p/569909#M101036</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have difficulty to break a json into multiple events.&lt;/P&gt;&lt;P&gt;Here is my log : (appear in one event, instead of 2)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
    "InstanceInformationList": [
        {
            "Version": false, 
            "PlatformName": "Amazon Linux", 
            "ComputerName": "ip-10-170-216-17.eu-east-1.compute.internal"
        }, 
        {
            "PlatformType": "Linux",  
            "IPAddress": "10.170.216.18", 
            "AssociationOverview": {
                "DetailedStatus": "Failed", 
                "InstanceAssociationStatusAggregatedCount": {
                    "Failed": 1, 
                    "Success": 1
                }
            }, 
            "AssociationStatus": "Failed",  
            "PlatformVersion": "2", 
            "ComputerName": "ip-10-170-216-18.eu-east-1.compute.internal", 
            "InstanceId": "i-00000000001", 
            "PlatformName": "Amazon Linux"
        }
    ]
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="view-original-post-link"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;And you can find my props.conf below :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[my_test]
SHOULD_LINEMERGE = false
INDEXED_EXTRACTIONS = json
DATETIME_CONFIG = CURRENT
TRUNCATE = 999999
JSON_TRIM_BRACES_IN_ARRAY_NAMES = true
BREAK_ONLY_BEFORE = (\[\s+\{)
MUST_BREAK_AFTER = (\},|\}\s+\])
SEDCMD-remove_header = s/(\{\s+.+?\[)//g
SEDCMD-remove_footer = s/\]\s+\}//g&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you help me to find the write parsing please ?&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Oct 2021 15:22:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-break-a-json-log-into-multiple-events/m-p/569909#M101036</guid>
      <dc:creator>mah</dc:creator>
      <dc:date>2021-10-06T15:22:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to break a json log into multiple events</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-break-a-json-log-into-multiple-events/m-p/569928#M101038</link>
      <description>&lt;P&gt;Where do you want to break the event?&lt;/P&gt;</description>
      <pubDate>Wed, 06 Oct 2021 17:22:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-break-a-json-log-into-multiple-events/m-p/569928#M101038</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2021-10-06T17:22:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to break a json log into multiple events</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-break-a-json-log-into-multiple-events/m-p/569991#M101041</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to break where I have : closed braces / comma / opened braces :&lt;/P&gt;&lt;PRE&gt;   "ComputerName": "ip-10-170-216-17.eu-east-1.compute.internal"
        }, 
        {
            "PlatformType": "Linux",  &lt;/PRE&gt;&lt;P&gt;Thanks a lot for your help !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Oct 2021 07:21:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-break-a-json-log-into-multiple-events/m-p/569991#M101041</guid>
      <dc:creator>mah</dc:creator>
      <dc:date>2021-10-07T07:21:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to break a json log into multiple events</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-break-a-json-log-into-multiple-events/m-p/569997#M101043</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;You could try this.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval _raw = "{
    \"InstanceInformationList\": [
        {
            \"Version\": false,
            \"PlatformName\": \"Amazon Linux\",
            \"ComputerName\": \"ip-10-170-216-17.eu-east-1.compute.internal\"
        },
        {
            \"PlatformType\": \"Linux\",
            \"IPAddress\": \"10.170.216.18\",
            \"AssociationOverview\": {
                \"DetailedStatus\": \"Failed\",
                \"InstanceAssociationStatusAggregatedCount\": {
                    \"Failed\": 1,
                    \"Success\": 1
                }
            },
            \"AssociationStatus\": \"Failed\",
            \"PlatformVersion\": \"2\",
            \"ComputerName\": \"ip-10-170-216-18.eu-east-1.compute.internal\",
            \"InstanceId\": \"i-00000000001\",
            \"PlatformName\": \"Amazon Linux\"
        }
    ]
}"
| spath output=Computer path=InstanceInformationList{}.ComputerName&lt;/LI-CODE&gt;&lt;P&gt;Using above you could get mv field Computer where are those ComputerNames.&lt;/P&gt;&lt;P&gt;r. Ismo&lt;/P&gt;</description>
      <pubDate>Thu, 07 Oct 2021 07:45:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-break-a-json-log-into-multiple-events/m-p/569997#M101043</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2021-10-07T07:45:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to break a json log into multiple events</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-break-a-json-log-into-multiple-events/m-p/570002#M101045</link>
      <description>&lt;P&gt;I want to break the json at indextime because mvexpand command is ressource consuming.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want&amp;nbsp; to separate the json in order to have 1 braces by event :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;One event :&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;{ "Version": false, "PlatformName": "Amazon Linux", "ComputerName": "ip-10-170-216-17.eu-east-1.compute.internal" }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;another event&lt;/STRONG&gt; :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;{ "PlatformType": "Linux", "IPAddress": "10.170.216.18", "AssociationOverview": { "DetailedStatus": "Failed", "InstanceAssociationStatusAggregatedCount": { "Failed": 1, "Success": 1 } }, "AssociationStatus": "Failed", "PlatformVersion": "2", "ComputerName": "ip-10-170-216-18.eu-east-1.compute.internal", "InstanceId": "i-00000000001", "PlatformName": "Amazon Linux" }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Wherever there is this :&amp;nbsp;}, {&amp;nbsp; split the json by using setting in props.conf&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Oct 2021 07:59:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-break-a-json-log-into-multiple-events/m-p/570002#M101045</guid>
      <dc:creator>mah</dc:creator>
      <dc:date>2021-10-07T07:59:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to break a json log into multiple events</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-break-a-json-log-into-multiple-events/m-p/570723#M101139</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Are you really sure that you want break that JSON to several events on indexing time? If you do it then you cannot manage it as whole JSON instance later on?&lt;/P&gt;&lt;P&gt;If this is really what you want to do, you could try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;DATETIME_CONFIG=CURRENT
SHOULD_LINEMERGE=true
LINE_BREAKER=(\s+\[\s+\{)|(\s+\},\s+\{\s+)|(\}\s+\])
NO_BINARY_CHECK=true
TRUNCATE=0&lt;/LI-CODE&gt;&lt;P&gt;Basically you must forget that this is JSON and manage it as normal text event.&lt;/P&gt;&lt;P&gt;I think that you must use separate transforms.conf to get rid of those "unnecessary" header and footer. Based on order which props + transforms are handled you cannot use SEDCMD in this case.&amp;nbsp;&lt;/P&gt;&lt;P&gt;r. Ismo&lt;/P&gt;</description>
      <pubDate>Wed, 13 Oct 2021 09:00:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-break-a-json-log-into-multiple-events/m-p/570723#M101139</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2021-10-13T09:00:30Z</dc:date>
    </item>
  </channel>
</rss>

