Unexpected character ('s' (code 115))

Solved!
hisyam
Level 3
Unexpected character ('s' (code 115))

I imported the audit log files under

/run/audit

and tried to filter out rows using the filter recipe where the condition is:

logger == dku.audit.generic and no sampling method.

but the job failed and gave me an error which says

Unexpected character ('s' (code 115)): was expecting a colon to separate field name and value at [Source: (com.google.common.io.CountingInputStream); line: 88625, column: 335]

Can anyone help me on this?


Operating system used: Linux

0 Kudos
1 Solution
JordanB
Dataiker

Hi @hisyam,

This appears to be specific to JSON parsing. Please try changing the settings on your source dataset (Settings > Format / Preview) and change the Type from "JSON" to "One record per line". (Make sure to click RELOAD SCHEMA FROM DETECTED DATA if prompted to):

Screenshot 2023-07-19 at 5.55.00 PM.png

Create the filter recipe and add the filter dku.audit.generic.

Next create a Prepare Recipe of that dataset and first add a step to use the Unnest object Processor to flatten the JSON.

Screenshot 2023-07-19 at 5.58.49 PM.png

Please let me know if you have any questions.

Thanks!

Jordan

View solution in original post

3 Replies
JordanB
Dataiker

Hi @hisyam,

This appears to be specific to JSON parsing. Please try changing the settings on your source dataset (Settings > Format / Preview) and change the Type from "JSON" to "One record per line". (Make sure to click RELOAD SCHEMA FROM DETECTED DATA if prompted to):

Screenshot 2023-07-19 at 5.55.00 PM.png

Create the filter recipe and add the filter dku.audit.generic.

Next create a Prepare Recipe of that dataset and first add a step to use the Unnest object Processor to flatten the JSON.

Screenshot 2023-07-19 at 5.58.49 PM.png

Please let me know if you have any questions.

Thanks!

Jordan

hisyam
Level 3
Author

Thank you, Jordan! 

Well the only question I have is why did the filter recipe failed? The JSON parsing worked fine to produce the dataset. And I'm only checking for matching rows in the logger column which is a string type. Which intuitively, should have worked.

0 Kudos
JordanB
Dataiker

Hi @hisyam,

This error typically occurs when one of your audit files is broken. In order to fix it, you would have to manually review it. You can use the "jq" tool to identify the faulty record.
 
Please note that we strongly recommend that you do not use run/audit files for automated processing, but rather use the DSS event server (ref: https://doc.dataiku.com/dss/latest/operations/audit-trail/eventserver.html
 
Thanks!
Jordan
0 Kudos

Labels

?
Labels (1)
A banner prompting to get Dataiku