Splunk Search

Search not retuning all values from a array search

brytox
New Member

HI

Im trying to get data from an object containing an array, and my search returns some of the results but i cant see why I dont get them all. 

The data looks like this:

 

{
  "severity": "INFO",
  "name": "C758JH9",
  "items": [
    {
      "Name": "C758JH9",
      "Operating System": "Microsoft Windows 10 Enterprise",
      "ArticleID": "2920724",
      "ResourceId": "16783579",
      "LastStatusCheckTime": "20200713175056.983000+000",
      "DateCreated": "20170710214528.000000+000",
      "LocalizedDisplayName": "Update for Microsoft Office 2016 (KB2920724) 32-Bit Edition",
      "LastStatusCheckTime1": "20200713175056.983000+000",
      "LastLogonUserName": "saurpal",
      "LastLogonTimestamp": "20200703164437.000000+***",
      "Status CHnage": "20200713175056.983000+000",
      "Superseeded": "False",
      "Status": "INSTALLED"
    },
    {
      "Name": "C758JH9",
      "Operating System": "Microsoft Windows 10 Enterprise",
      "ArticleID": "2920712",
      "ResourceId": "16783579",
      "LastStatusCheckTime": "20200713175057.787000+000",
      "DateCreated": "20170710214536.000000+000",
      "LocalizedDisplayName": "Update for Microsoft Office 2016 (KB2920712) 32-Bit Edition",
      "LastStatusCheckTime1": "20200713175057.787000+000",
      "LastLogonUserName": "saurpal",
      "LastLogonTimestamp": "20200703164437.000000+***",
      "Status CHnage": "20200713175057.787000+000",
      "Superseeded": "False",
      "Status": "INSTALLED"
    },
    {
      "Name": "C758JH9",
      "Operating System": "Microsoft Windows 10 Enterprise",
      "ArticleID": "2920727",
      "ResourceId": "16783579",
      "LastStatusCheckTime": "20200713175056.407000+000",
      "DateCreated": "20170710214612.000000+000",
      "LocalizedDisplayName": "Security Update for Microsoft Office 2016 (KB2920727) 32-Bit Edition",
      "LastStatusCheckTime1": "20200713175056.407000+000",
      "LastLogonUserName": "saurpal",
      "LastLogonTimestamp": "20200703164437.000000+***",
      "Status CHnage": "20200713175056.407000+000",
      "Superseeded": "False",
      "Status": "INSTALLED"
    },
    {
      "Name": "C758JH9",
      "Operating System": "Microsoft Windows 10 Enterprise",
      "ArticleID": "3114690",
      "ResourceId": "16783579",
      "LastStatusCheckTime": "20200713175057.047000+000",
      "DateCreated": "20170710214844.000000+000",
      "LocalizedDisplayName": "Security Update for Microsoft Office 2016 (KB3114690) 32-Bit Edition",
      "LastStatusCheckTime1": "20200713175057.047000+000",
      "LastLogonUserName": "saurpal",
      "LastLogonTimestamp": "20200703164437.000000+***",

 

 

The set is much bigger, this one set has 77 entries, im trying to get a table to show the LocalizedDisplayName and the Status, can be one of a few entires. When i run the blow search it returns me 25 records.

 

index="patching" | spath "name" | search name=LEWKPW10DSK121 
| spath
| fields - _raw _time
| rename items{}.* as * 
| eval data=mvzip(mvzip(LocalizedDisplayName,Status),ArticleID)
| fields data
| mvexpand data
| makemv data delim=","
| eval LocalizedDisplayName=mvindex(data,0)
| eval Status=mvindex(data,1)
| eval ArticleID=mvindex(data,2)
| table Status LocalizedDisplayName ArticleID

 

 

Any pointers would be great. Thanks.

Labels (1)
Tags (2)
0 Karma

brytox
New Member

Seems I was overthinking it.

 

This gives me the data i needed

 

 

 

index="patching" | spath "name" | search name=C758JH9  | spath path=items{} output=report | mvexpand report | spath input=report | fields Status, LocalizedDisplayName, ArticleID | table Status, LocalizedDisplayName, ArticleID

 

 

 

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Laser Bananas and Edge Hubs: Exploring Operational Technology (OT) Data Through a ...

  OT is a different environment to traditional IT and can have interesting challenges when interfacing the ...

Event Series: Mastering AI Tokenomics and Splunk Agent Observability

Beyond the Black Box: Correlating AI Performance and Tokenomics with Splunk Agent Observability   As ...

span_metrics: The OpenTelemetry-Idiomatic Way to See Inside Your Services

You open a trace in Splunk Observability Cloud and everything looks fine. One root span, order-pipeline, with ...