Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8504763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:07:35+00:00 2026-06-11T02:07:35+00:00

Background: I have the following example data structure in JSON: {‘sensor’ : [ {‘assertions_enabled’:

  • 0

Background:

I have the following example data structure in JSON:

{'sensor' : [
    {'assertions_enabled': 'ucr+',
     'deassertions_enabled': 'ucr+',
     'entity_id': '7.0',
     'lower_critical': 'na',
     'lower_non_critical': 'na',
     'lower_non_recoverable': 'na',
     'reading_type': 'analog',
     'sensor_id': 'SR5680 TEMP (0x5d)',
     'sensor_reading': {'confidence_interval': '0.500',
                    'units': 'degrees C',
                    'value': '42'},
     'sensor_type': 'Temperature',
     'status': 'ok',
     'upper_critical': '59.000',
     'upper_non_critical': 'na',
     'upper_non_recoverable': 'na'}
]}

The sensor list will actually contain many of these dicts containing sensor info.

Problem:

I’m trying to query the list using jsonpath to return me a subset of sensor dicts that have sensor_type=='Temperature' but I’m getting 'False' returned (no match). Here’s my jsonpath expression:

results = jsonpath.jsonpath(ipmi_node, "$.sensor[?(@.['sensor_type']=='Temperature')]")

When I remove the filter expression and just use "$.sensor.*" I get a list of all sensors, so I’m sure the problem is in the filter expression.

I’ve scanned multiple sites/posts for examples and I can’t seem to find anything specific to Python (Javascript and PHP seem to be more prominent). Could anyone offer some guidance please?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T02:07:37+00:00Added an answer on June 11, 2026 at 2:07 am

    The following expression does what you need (notice how the attribute is specified):

    jsonpath.jsonpath(impi_node, "$.sensor[?(@.sensor_type=='Temperature')]")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In the following example, I have a custom JComponent being drawn on green background,
Say for example I have the following styles: #HorizNav ul li a.active:link { background-color:
I have seen following CSS rule at two website /* First example */ background:
Background: Suppose I have the following obviously-incorrect PHP: try{ $vtest = ''; print(array_pop($vtest)); }catch(Exception
I have following Image as src in ImageView. I use this as background image.
I have the following code a.rollover { background-image: url('sprite.jpg'); display: block; width: 191px; height:
i have the following script css: img { background-image:url(man.png); background-repeat:no-repeat; padding-top:6px; padding-bottom:60px; padding-left:10px; padding-right:10px;
i have the following code which switches some fullscreen-background-images (fadeOut, fadeIn). setInterval(function() { var
I have the following HTML page and the background color for the content is
I have the following code that sets a background if user has uploaded to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.