This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Accept
Reject

NetWitness Community

  • Home
  • Products
    • NetWitness Platform
      • Advisories
      • Documentation
        • Platform Documentation
        • Known Issues
        • Security Fixes
        • Hardware Documentation
        • Threat Content
        • Unified Data Model
        • Videos
      • Downloads
      • Integrations
      • Knowledge Base
    • NetWitness Cloud SIEM
      • Advisories
      • Documentation
      • Knowledge Base
    • NetWitness Detect AI
      • Advisories
      • Documentation
      • Knowledge Base
    • NetWitness Investigator
    • NetWitness Orchestrator
      • Advisories
      • Documentation
      • Knowledge Base
      • Legacy NetWitness Orchestrator
        • Advisories
        • Documentation
  • Community
    • Blog
    • Discussions
    • Events
    • Idea Exchange
  • Support
    • Case Portal
      • Create New Case
      • View My Cases
      • View My Team's Cases
    • Community Support
      • Getting Started
      • News & Announcements
      • Community Support Forum
      • Community Support Articles
    • Product Life Cycle
    • Support Information
    • General Security Advisories
  • Training
    • Blog
    • Certification Program
    • Course Catalog
    • New Product Readiness
    • On-Demand Subscriptions
    • Student Resources
    • Upcoming Events
  • Technology Partners
  • Trust Center
Sign InRegister Now
cancel
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for 
Search instead for 
Did you mean: 
NetWitness Discussions
Announcement Banner

Users are unable to open Netwitness Support Cases via email. Please open support cases via portal or by phone

View Details
  • NetWitness Community
  • Discussions
  • Need help to parse JSON log
  • Options
    • Subscribe to RSS Feed
    • Mark Topic as New
    • Mark Topic as Read
    • Float this Topic for Current User
    • Bookmark
    • Subscribe
    • Mute
    • Printer Friendly Page

Need help to parse JSON log

Go to solution
MaximMarchenko
MaximMarchenko Occasional Contributor
Occasional Contributor
Options
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

‎2022-01-24 06:41 AM

Hello.

First of all, I've read this article and tried to do such thing, but no luck.

Logs are from MongoDB Community event source.

Log example:

"Jan 24 16:30:10 mongodb-linux-test-1 MONGODB-AUDIT: {"t":{"$date":"2022-01-24T16:30:01.081+06:00"},"s":"I", "c":"NETWORK", "id":22943, "ctx":"listener","msg":"Connection accepted","attr":{"remote":"192.168.1.100:58595","connectionId":37,"connectionCount":1}}"

I've tried to parse only these ("s":"I", "c":"NETWORK", "id":22943)

My log parser file is:

<?xml version="1.0" encoding="UTF-8"?>


<DEVICEMESSAGES
    name="mongodb_audit_custom"
    displayname="MONGODB CUSTOM"
    group="Database">

<VERSION
    xml="62"
    checksum="47a2bb0d3341b498eb15e4e72ebf1916"
    revision="143"
    device="2.0" />

<HEADER
    id1="0001"
    id2="0001"
    content="&lt;fld&gt; &lt;fld&gt; &lt;fld&gt; &lt;hhost&gt; &lt;messageid&gt;: &lt;!payload&gt;"/>
 
<MESSAGE
        id1="MONGODB-AUDIT"
        id2="MONGODB-AUDIT"
        content="&lt;logstash_json_payload&gt;" />

<VARTYPE name="logstash_json_payload" dataType="FileBeatsEvent"/>

<DataType name="ElasticCommonSchemaSubset" format="JSON">
   <Capture key="/s" meta="severity" />
   <Capture key="/c" meta="ec_subject" />
   <Capture key="/id" meta="reference_id" />
</DataType>

 

After (re-)deployment I've get such result(message id is OK, but no metas of severity, reference, subject):

MaximMarchenko_0-1643024411747.png

Please, explain what is wrong with my parser file.

0 Likes
Share
Reply
  • All forum topics
  • Previous Topic
  • Next Topic
1 ACCEPTED SOLUTION

Accepted Solutions

Go to solution
MaximMarchenko
MaximMarchenko Occasional Contributor
Occasional Contributor
Options
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

‎2022-01-25 03:32 AM

I've managed to find the error by myself:

<VARTYPE name="logstash_json_payload" dataType="FileBeatsEvent"/>

...

<DataType name="ElasticCommonSchemaSubset" format="JSON">
...
These name must be the same:
<VARTYPE name="logstash_json_payload" dataType="FileBeatsEvent"/>

...

<DataType name="FileBeatsEvent" format="JSON">
...
 
The result is: I get all my metas, described in <Capture ...>.
 
So somebody in RSA must fix this article .
Also in sections:
<VARTYPE name="logstash_json_payload" dataType=FileBeatsEvent"/>

<DataType name="InternetTime" dateTime="%W-%M-%DT%H:%T:%S.%V%E" />

<DataType name="CollectionTime" type="InternetTime" meta="lc.ctime"/>

<DataType name="ElasticCommonSchemaSubset" format="JSON">
<Capture key="/@timestamp"> type="CollectionTime" />
<Capture key="/host/hostname"> meta="alias.host" />
<Capture key="/host/id"> meta="hardware.id" />
<Capture key="/host/os/name"> meta="OS" />
</DataType>

View solution in original post

0 Likes
Share
Reply
4 REPLIES 4

Go to solution
MaximMarchenko
MaximMarchenko Occasional Contributor
Occasional Contributor
Options
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

‎2022-01-25 03:32 AM

I've managed to find the error by myself:

<VARTYPE name="logstash_json_payload" dataType="FileBeatsEvent"/>

...

<DataType name="ElasticCommonSchemaSubset" format="JSON">
...
These name must be the same:
<VARTYPE name="logstash_json_payload" dataType="FileBeatsEvent"/>

...

<DataType name="FileBeatsEvent" format="JSON">
...
 
The result is: I get all my metas, described in <Capture ...>.
 
So somebody in RSA must fix this article .
Also in sections:
<VARTYPE name="logstash_json_payload" dataType=FileBeatsEvent"/>

<DataType name="InternetTime" dateTime="%W-%M-%DT%H:%T:%S.%V%E" />

<DataType name="CollectionTime" type="InternetTime" meta="lc.ctime"/>

<DataType name="ElasticCommonSchemaSubset" format="JSON">
<Capture key="/@timestamp"> type="CollectionTime" />
<Capture key="/host/hostname"> meta="alias.host" />
<Capture key="/host/id"> meta="hardware.id" />
<Capture key="/host/os/name"> meta="OS" />
</DataType>
0 Likes
Share
Reply

Go to solution
NamYongCho
Contributor NamYongCho Contributor
Contributor
In response to MaximMarchenko
Options
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

‎2022-02-07 02:56 AM

If the message is logstash/JSON, there is an easier way.
From v11.6, you can utilize Logstash/Beats plugin on Log Collector and use JSON Mappings on Log Parser Rules configuration.
Please, refer the attached ppt deck as an example.
Instead of writing a new parser, you can do same thing on web UI.

NamYongCho_0-1644220293109.png

 

Preview file
4365 KB
0 Likes
Share
Reply

Go to solution
anusha_rampure
anusha_rampure New Contributor
New Contributor
In response to NamYongCho
Options
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

4 weeks ago

Hi,

 

If we make use of json mapping feature for logstash logs, how will it identify the header? As we will be using the header while mapping?

0 Likes
Share
Reply

Go to solution
NamYongCho
Contributor NamYongCho Contributor
Contributor
In response to anusha_rampure
Options
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

2 weeks ago - last edited 2 weeks ago

For the JSON mapping, there is no concept of headers and messages.

As JSON is structured data, you only need to define hierachical path for each values.

 

NamYongCho_0-1655194669511.png

 

1 Like
Share
Reply
Powered by Khoros
  • Blog
  • Events
  • Discussions
  • Idea Exchange
  • Knowledge Base
  • Case Portal
  • Community Support
  • Product Life Cycle
  • Support Information
  • About the Community
  • Terms & Conditions
  • Privacy Statement
  • Acceptable Use Policy
  • Employee Login
© 2022 RSA Security LLC or its affiliates. All rights reserved.