<?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: About Parsing JSON Log in splunk in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/About-Parsing-JSON-Log-in-splunk/m-p/654818#M226202</link>
    <description>&lt;P&gt;What is the problem with default line breaker? &amp;nbsp;Unless you can describe a specific problem,&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Data/Configureeventlinebreaking" target="_blank" rel="noopener"&gt;Configure event line breaking&lt;/A&gt;&amp;nbsp;is the best suggestion others can give.&lt;/P&gt;</description>
    <pubDate>Fri, 18 Aug 2023 08:27:08 GMT</pubDate>
    <dc:creator>yuanliu</dc:creator>
    <dc:date>2023-08-18T08:27:08Z</dc:date>
    <item>
      <title>About Parsing JSON Log in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/About-Parsing-JSON-Log-in-splunk/m-p/654801#M226194</link>
      <description>&lt;P&gt;&amp;lt;6&amp;gt;2023-08-17T04:51:52Z 49786672a6c4 PICUS[1]: {"common":{"unique_id":"6963f063-a68d-482c-a22a-9e96ada33126","time":"2023-08-17T04:51:51.668553048Z","type":"","action":"","user_id":0,"user_email":"","user_first_name":"","user_last_name":"","account_id":7161,"ip":"","done_with_api":false,"platform_licences":null},"data":{"ActionID":26412,"ActionName":"Zebrocy Malware Downloader used by APT28 Threat Group .EXE File Download Variant-3","AgentName":"VICTIM-99","AssessmentName":"LAB02","CVE":"_","DestinationPort":"443","File":"682822.exe","Hash":"eb81c1be62f23ac7700c70d866e84f5bc354f88e6f7d84fd65374f84e252e76b","Result":{"alert_result":"","has_detection_result":false,"logging_result":"","prevention_result":"blocked"},"RunID":109802,"SimulationID":36236,"SourcePort":"51967","Time":5}}&lt;BR /&gt;&lt;BR /&gt;I have a raw log like that, can you help me to parsing it into seperated lines ?&lt;/P&gt;</description>
      <pubDate>Fri, 18 Aug 2023 07:08:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/About-Parsing-JSON-Log-in-splunk/m-p/654801#M226194</guid>
      <dc:creator>huylbq</dc:creator>
      <dc:date>2023-08-18T07:08:46Z</dc:date>
    </item>
    <item>
      <title>Re: About Parsing JSON Log in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/About-Parsing-JSON-Log-in-splunk/m-p/654803#M226195</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/259796"&gt;@huylbq&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;usually json files aren't divided in separated lines because there's an header commo to more definitions.&lt;/P&gt;&lt;P&gt;You can extract all the fields using the "INDEXED_EXTRACTIONS = json" option in the sourcetype or the "spath" command (&lt;A href="https://community.splunk.com/t5/Splunk-Enterprise/spath-command/m-p/518343" target="_blank"&gt;https://community.splunk.com/t5/Splunk-Enterprise/spath-command/m-p/518343&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 18 Aug 2023 07:15:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/About-Parsing-JSON-Log-in-splunk/m-p/654803#M226195</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-08-18T07:15:10Z</dc:date>
    </item>
    <item>
      <title>Re: About Parsing JSON Log in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/About-Parsing-JSON-Log-in-splunk/m-p/654812#M226198</link>
      <description>&lt;P&gt;Like&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;said, you don't need to parse raw logs into separate lines. &amp;nbsp;You just need to extract the part that is compliant JSON, then use spath to extract JSON nodes into Splunk fields.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval json = replace(_raw, "^[^\{]+", "")
| spath input=json&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your sample event gives&lt;/P&gt;&lt;TABLE width="1955px"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="159.453125px"&gt;common.account_id&lt;/TD&gt;&lt;TD width="123.34375px"&gt;common.action&lt;/TD&gt;&lt;TD width="185.984375px"&gt;common.done_with_api&lt;/TD&gt;&lt;TD width="59px"&gt;...&lt;/TD&gt;&lt;TD width="40px"&gt;data.Time&lt;/TD&gt;&lt;TD width="1389.421875px"&gt;json&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="159.453125px"&gt;7161&lt;/TD&gt;&lt;TD width="123.34375px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="185.984375px"&gt;false&lt;/TD&gt;&lt;TD width="59px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="40px"&gt;5&lt;/TD&gt;&lt;TD width="1389.421875px"&gt;{"common":{"unique_id":"6963f063-a68d-482c-a22a-9e96ada33126","time":"2023-08-17T04:51:51.668553048Z","type":"","action":"","user_id":0,"user_email":"","user_first_name":"","user_last_name":"","account_id":7161,"ip":"","done_with_api":false,"platform_licences":null},"data":{"ActionID":26412,"ActionName":"Zebrocy Malware Downloader used by APT28 Threat Group .EXE File Download Variant-3","AgentName":"VICTIM-99","AssessmentName":"LAB02","CVE":"_","DestinationPort":"443","File":"682822.exe","Hash":"eb81c1be62f23ac7700c70d866e84f5bc354f88e6f7d84fd65374f84e252e76b","Result":{"alert_result":"","has_detection_result":false,"logging_result":"","prevention_result":"blocked"},"RunID":109802,"SimulationID":36236,"SourcePort":"51967","Time":5}}&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Here is an emulation you can play with and compare with real data&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval _raw = "&amp;lt;6&amp;gt;2023-08-17T04:51:52Z 49786672a6c4 PICUS[1]: {\"common\":{\"unique_id\":\"6963f063-a68d-482c-a22a-9e96ada33126\",\"time\":\"2023-08-17T04:51:51.668553048Z\",\"type\":\"\",\"action\":\"\",\"user_id\":0,\"user_email\":\"\",\"user_first_name\":\"\",\"user_last_name\":\"\",\"account_id\":7161,\"ip\":\"\",\"done_with_api\":false,\"platform_licences\":null},\"data\":{\"ActionID\":26412,\"ActionName\":\"Zebrocy Malware Downloader used by APT28 Threat Group .EXE File Download Variant-3\",\"AgentName\":\"VICTIM-99\",\"AssessmentName\":\"LAB02\",\"CVE\":\"_\",\"DestinationPort\":\"443\",\"File\":\"682822.exe\",\"Hash\":\"eb81c1be62f23ac7700c70d866e84f5bc354f88e6f7d84fd65374f84e252e76b\",\"Result\":{\"alert_result\":\"\",\"has_detection_result\":false,\"logging_result\":\"\",\"prevention_result\":\"blocked\"},\"RunID\":109802,\"SimulationID\":36236,\"SourcePort\":\"51967\",\"Time\":5}}"
| eval json = replace(_raw, "^[^\{]+", "")
``` data emulation above ```&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;</description>
      <pubDate>Fri, 18 Aug 2023 07:45:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/About-Parsing-JSON-Log-in-splunk/m-p/654812#M226198</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-08-18T07:45:29Z</dc:date>
    </item>
    <item>
      <title>Re: About Parsing JSON Log in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/About-Parsing-JSON-Log-in-splunk/m-p/654814#M226200</link>
      <description>&lt;P&gt;Any suggestion about Line breaker in props.conf or transform.conf&lt;/P&gt;</description>
      <pubDate>Fri, 18 Aug 2023 07:56:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/About-Parsing-JSON-Log-in-splunk/m-p/654814#M226200</guid>
      <dc:creator>huylbq</dc:creator>
      <dc:date>2023-08-18T07:56:48Z</dc:date>
    </item>
    <item>
      <title>Re: About Parsing JSON Log in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/About-Parsing-JSON-Log-in-splunk/m-p/654818#M226202</link>
      <description>&lt;P&gt;What is the problem with default line breaker? &amp;nbsp;Unless you can describe a specific problem,&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Data/Configureeventlinebreaking" target="_blank" rel="noopener"&gt;Configure event line breaking&lt;/A&gt;&amp;nbsp;is the best suggestion others can give.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Aug 2023 08:27:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/About-Parsing-JSON-Log-in-splunk/m-p/654818#M226202</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-08-18T08:27:08Z</dc:date>
    </item>
  </channel>
</rss>

