<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Splunk query in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Splunk-query/m-p/687699#M234548</link>
    <description>&lt;P&gt;I'm not sure what you mean but if you want the value of the newValue field from the first object in the modifiedProperties array, you can use spath to extract value from particular node of your json structure.&lt;/P&gt;&lt;PRE&gt;| spath targetResources[0].modifiedProperties[0].newValue[0]&lt;/PRE&gt;&lt;P&gt;(if I remember the path syntax correctly; writing from memory)&lt;/P&gt;</description>
    <pubDate>Thu, 16 May 2024 08:02:10 GMT</pubDate>
    <dc:creator>PickleRick</dc:creator>
    <dc:date>2024-05-16T08:02:10Z</dc:date>
    <item>
      <title>Splunk query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-query/m-p/687673#M234537</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi All, hope you are having a great day, I have a quick question. I have the data given as below, how do i extract just the first value if attribute newValue (in our Eg., its "None"), first value of newValue keeps changing so cannot be hard-coded.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;```{}```&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;targetResources: [&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;displayName: null&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;groupType: null&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;id: f61b1166&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;modifiedProperties: [&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;displayName: PasswordPolicies&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;newValue&lt;/STRONG&gt;&lt;SPAN&gt;: ["None"]&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;extract only this value&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;oldValue: ["DisablePasswordExpiration"]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;displayName: Included Updated Properties&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;newValue: "PasswordPolicies"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;oldValue: null&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;displayName: TargetId.UserType&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;newValue: "Member"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;oldValue: null&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2024 03:21:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-query/m-p/687673#M234537</guid>
      <dc:creator>ash2</dc:creator>
      <dc:date>2024-05-16T03:21:29Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-query/m-p/687680#M234540</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/261950"&gt;@ash2&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;please try this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex max_match=1 "(?ms)newValue:\s+\[*\"(?&amp;lt;newValue&amp;gt;[^\"]+)"&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2024 05:17:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-query/m-p/687680#M234540</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-05-16T05:17:55Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-query/m-p/687683#M234541</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN&gt;Giuseppe,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you for the query, unfortunately its not working for me.&amp;nbsp;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ash2_0-1715837329255.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/30831i4FF4C6A6756F4AAB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ash2_0-1715837329255.png" alt="ash2_0-1715837329255.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2024 05:29:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-query/m-p/687683#M234541</guid>
      <dc:creator>ash2</dc:creator>
      <dc:date>2024-05-16T05:29:06Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-query/m-p/687689#M234545</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/261950"&gt;@ash2&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;max_match is an option of the rex command that says to the rex to take only the first extracted value, it isn't a field to display.&lt;/P&gt;&lt;P&gt;please try this (adding the new field (newValue2) to the table to see the difference:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex max_match=1 "(?ms)newValue:\s+\[*\"(?&amp;lt;newValue2&amp;gt;[^\"]+)"&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2024 07:05:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-query/m-p/687689#M234545</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-05-16T07:05:23Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-query/m-p/687699#M234548</link>
      <description>&lt;P&gt;I'm not sure what you mean but if you want the value of the newValue field from the first object in the modifiedProperties array, you can use spath to extract value from particular node of your json structure.&lt;/P&gt;&lt;PRE&gt;| spath targetResources[0].modifiedProperties[0].newValue[0]&lt;/PRE&gt;&lt;P&gt;(if I remember the path syntax correctly; writing from memory)&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2024 08:02:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-query/m-p/687699#M234548</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-05-16T08:02:10Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-query/m-p/687974#M234614</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN&gt;Giuseppe,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thank you for highlighting the mistake. I corrected the variable to newValue2 but unfortunately I found no luck&amp;nbsp; with the&amp;nbsp; query.&lt;/P&gt;</description>
      <pubDate>Sun, 19 May 2024 23:53:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-query/m-p/687974#M234614</guid>
      <dc:creator>ash2</dc:creator>
      <dc:date>2024-05-19T23:53:35Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-query/m-p/687978#M234615</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231884"&gt;@PickleRick&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;the query line you posted is not supported, not if it was before. Splunk is erring out saying unknown value 0&lt;/P&gt;</description>
      <pubDate>Mon, 20 May 2024 02:25:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-query/m-p/687978#M234615</guid>
      <dc:creator>ash2</dc:creator>
      <dc:date>2024-05-20T02:25:17Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-query/m-p/688092#M234636</link>
      <description>&lt;P&gt;I found the solution.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval firstNewValue = mvindex(newValue,0)&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2024 00:24:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-query/m-p/688092#M234636</guid>
      <dc:creator>ash2</dc:creator>
      <dc:date>2024-05-21T00:24:46Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-query/m-p/688100#M234638</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/261950"&gt;@ash2&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;good for you, see next time!&lt;/P&gt;&lt;P&gt;Ciao and happy splunking&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;P.S.: Karma Points are appreciated by all the contributors &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2024 05:25:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-query/m-p/688100#M234638</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-05-21T05:25:34Z</dc:date>
    </item>
  </channel>
</rss>

