简体   繁体   English

如何克服 WARNING: Resulting JSON is truncated as serialization has exceeded the set depth of 2?

[英]How to overcome WARNING: Resulting JSON is truncated as serialization has exceeded the set depth of 2?

Have provided my code and json format below.在下面提供了我的代码和 json 格式。 I'm using powershell runbook to retrieve the values from this json. But facing error.我正在使用 powershell 运行手册从此 json 中检索值。但遇到错误。 Can anyone please help me out regarding the same?任何人都可以帮我解决这个问题吗?

My json:我的json:

{"hunting": [
  {
    "displayName":"New Changes made to AWS IAM policy", 
    "description":"test",
    "query":"SecurityEvent | where EventID == \"4687\" | where CommandLine contains \"-noni -ep bypass $\"",
    "tactics":["Persistence","LateralMovement","Collection"]
  },{
    "displayName":"New Consent to Application discovery",
    "description":"test",
    "query":"SecurityEvent | where EventID == \"4688\" | where CommandLine contains \"-noni -ep bypass $\"",
    "tactics":["Persistence","LateralMovement"]
   }
]}

My code:我的代码:

Get-AzStorageBlobContent -Destination $outPath -Container $containerName -Blob $huntingQueryFileName  -Context $storageContext -Force

$newHuntingRules = Get-Content -Path "$outPath\$huntingQueryFileName" -Raw | ConvertFrom-Json  

Facing the below error:面对以下错误:

WARNING: Resulting JSON is truncated as serialization has exceeded the set depth of 2警告:结果 JSON 被截断,因为序列化已超过设置的深度 2

I executed below script in my environment and was able to successfully retrieve the expected content (from json format) .我在我的环境中执行了以下脚本,并且能够成功检索到预期的内容(来自 json 格式)

$path = "C:\temp"
$context = New-AzStorageContext -StorageAccountName "jahnavistorage" -StorageAccountKey "<storageaccountkey>=="
Get-AzStorageBlobContent -Container "<containerName>" -Blob "myjson.json" -Destination $path -context $context
Get-ChildItem -path $path
Get-Content -Raw $path\myjson.json | ConvertFrom-Json

Output: Output:

在此处输入图像描述

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 React 超过最大更新深度 | useEffect 与来自 firebase 的用户 - React maximum update depth exceeded | useEffect with user from firebase 如何解决flutter中的截断文本? - How to solve truncated text in flutter? 如何克服 ERR_CLEARTEXT_NOT_PERMITTED 错误? - How is the ERR_CLEARTEXT_NOT_PERMITTED error overcome? 如何使用 SQLAlchemy 和 Postgres 克服 2 小时连接超时 (OperationalError)? - How to overcome the 2hr connection timeout (OperationalError) using SQLAlchemy and Postgres? 我如何克服已经在 PM2 中使用的 EADDRESS - How do i overcome EADDRESS already in use in PM2 Firebase 已超出此项目错误的云存储配额 - Firebase cloud storage quota has been exceeded for this project error 如何使用 Zappa 解决 AWS Lambda 中的冷启动问题? - How to overcome cold start issue in AWS Lambda with Zappa? 使用 Azure 持久函数时如何克服平台依赖性? - How to overcome platform dependency while using Azure Durable Functions? 如何克服 AWS Glue 作业中的 Spark“设备上没有剩余空间”错误 - How to overcome Spark "No Space left on the device" error in AWS Glue Job Kube.netes 就绪探测警告没有详细信息 - Kubernetes readiness probe warning has no details
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM