<?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: Filtering values within JSON searching in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Filtering-values-within-JSON-searching/m-p/511664#M143463</link>
    <description>&lt;P&gt;GREAT!&amp;nbsp;&lt;/P&gt;&lt;P&gt;It works!&lt;/P&gt;&lt;P&gt;mvfilter is useful, i didn´t know about it, and single quotes is what i needed.&lt;/P&gt;&lt;P&gt;This is my final splunk query.&lt;/P&gt;&lt;P&gt;index="prod_super_cc" source=ETL_GRO_01ReadMessagesKafka| spath input=data.Orders | search "{}.LineRusherTransaction"="*" | table {}.LineRusherTransaction | eval LRTrans=mvfilter('{}.LineRusherTransaction'&amp;gt;0) | stats values(LRTrans)&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Wed, 29 Jul 2020 23:54:50 GMT</pubDate>
    <dc:creator>Rodrigo_Larios</dc:creator>
    <dc:date>2020-07-29T23:54:50Z</dc:date>
    <item>
      <title>Filtering values within JSON searching</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filtering-values-within-JSON-searching/m-p/511587#M143416</link>
      <description>&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;Hi, i'm trying to filter values greater than zero.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;I have this search: &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="verdana,geneva" color="#008080"&gt;index="prod_super_cc" source=ETL_GRO_01ReadMessagesKafka| spath input=data.Orders | search "{}.LineRusherTransaction"="*" | stats values({}.LineRusherTransaction) as LRTransactions&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;it brings some results including zero values and greater than zero values &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;LRTransactions &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;0&amp;nbsp;48580100196 48580100231 48580100687 48580100744 48580100909 48580100910 48580101088 48580101119 48580101320&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;But i want to remove zero values.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;I've tried using: | search "{}.LineRusherTransaction"&amp;gt;"0" | search "{}.LineRusherTransaction"&amp;gt;0 &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;also &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;| where LRTransactions&amp;gt;0 (No results) &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;I've tried with index="prod_super_cc" source=ETL_GRO_01ReadMessagesKafka| spath input=data.Orders | search "{}.LineRusherTransaction"="*" | table {}.LineRusherTransaction | where "{}.LineRusherTransaction" &amp;gt; 0 &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="verdana,geneva" color="#FF6600"&gt;Message says: Error in 'where' command: Type checking failed. The '&amp;gt;' operator received different types.&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":downcast_face_with_sweat:"&gt;😓&lt;/span&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;Without a expected result. I just want to filter values by removing zero values. Could you please help me please? Thank you&amp;nbsp;&lt;/FONT&gt;&lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jul 2020 17:19:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filtering-values-within-JSON-searching/m-p/511587#M143416</guid>
      <dc:creator>Rodrigo_Larios</dc:creator>
      <dc:date>2020-07-29T17:19:49Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering values within JSON searching</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filtering-values-within-JSON-searching/m-p/511648#M143449</link>
      <description>&lt;P&gt;You can use mvfilter to remove those values you do not want from your multi value field. See this run anywhere example.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval _raw="LRTransactions
0 48580100196 48580100231 48580100687 48580100744 48580100909 48580100910 48580101088 48580101119 48580101320"
| multikv forceheader=1
| eval LRTransactions=split(LRTransactions," ")
| table LRTransactions
| eval LRTransactions=mvfilter(LRTransactions&amp;gt;0)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;The last line is what you're after&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jul 2020 22:40:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filtering-values-within-JSON-searching/m-p/511648#M143449</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2020-07-29T22:40:19Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering values within JSON searching</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filtering-values-within-JSON-searching/m-p/511659#M143459</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;&amp;nbsp;, thanks for responding!&lt;/P&gt;&lt;P&gt;I just tried with this example but it still is not working.&lt;/P&gt;&lt;P&gt;I adapted it to my splunk query:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008080"&gt;index="prod_super_cc" source=ETL_GRO_01ReadMessagesKafka| spath input=data.Orders | search "{}.LineRusherTransaction"="*" | table {}.LineRusherTransaction | eval LR=mvfilter({}.LineRusherTransaction&amp;gt;0)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;The message i'm getting is:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF9900"&gt;&lt;SPAN&gt;Error in 'eval' command: The expression is malformed. An unexpected character is reached at '{}.LineRusherTransaction&amp;gt;0)'.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;SPAN&gt;I think the problem revolves around the&lt;/SPAN&gt;&lt;FONT color="#008080"&gt; {}.L&lt;/FONT&gt;&lt;SPAN&gt;&lt;FONT color="#008080"&gt;ineRusherTransaction&amp;nbsp;&lt;FONT color="#000000"&gt;which comes from a JSON property. Here you can see the example:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;SPAN&gt;&lt;FONT color="#008080"&gt;&lt;FONT color="#000000"&gt;{"OrderId":34399561,"TC":"04012745288666084055","TicketTypeCode":"Return","LineRusherTransaction":0},{"OrderId":34411872,"TC":"086094460458888015219","TicketTypeCode":"Sale","LineRusherTransaction":0},{"OrderId":34396744,"TC":"396044065436486007448","TicketTypeCode":"Sale","LineRusherTransaction":48580196744},{"OrderId":34412000,"TC":"986034168431288388420","TicketTypeCode":"Sale","LineRusherTransaction":0},&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;So, i'm trying to get all records with&amp;nbsp;&lt;FONT color="#000000"&gt;&lt;SPAN&gt;&lt;FONT color="#008080"&gt;LineRusherTransaction&amp;nbsp;&lt;FONT color="#000000"&gt;and then trying to remove zeros sending all values to a table and then removing with eval.&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;SPAN&gt;&lt;FONT color="#008080"&gt;&lt;FONT color="#000000"&gt;But i don´t know how to include this reference ({}.LineRusherTransaction) into the eval command.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;SPAN&gt;&lt;FONT color="#008080"&gt;&lt;FONT color="#000000"&gt;What do you think?&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jul 2020 23:26:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filtering-values-within-JSON-searching/m-p/511659#M143459</guid>
      <dc:creator>Rodrigo_Larios</dc:creator>
      <dc:date>2020-07-29T23:26:43Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering values within JSON searching</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filtering-values-within-JSON-searching/m-p/511661#M143461</link>
      <description>&lt;P&gt;eval statement need to have non standard field names surrounded with single quotes, so&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval LR=mvfilter('{}.LineRusherTransaction'&amp;gt;0)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jul 2020 23:32:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filtering-values-within-JSON-searching/m-p/511661#M143461</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2020-07-29T23:32:20Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering values within JSON searching</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filtering-values-within-JSON-searching/m-p/511664#M143463</link>
      <description>&lt;P&gt;GREAT!&amp;nbsp;&lt;/P&gt;&lt;P&gt;It works!&lt;/P&gt;&lt;P&gt;mvfilter is useful, i didn´t know about it, and single quotes is what i needed.&lt;/P&gt;&lt;P&gt;This is my final splunk query.&lt;/P&gt;&lt;P&gt;index="prod_super_cc" source=ETL_GRO_01ReadMessagesKafka| spath input=data.Orders | search "{}.LineRusherTransaction"="*" | table {}.LineRusherTransaction | eval LRTrans=mvfilter('{}.LineRusherTransaction'&amp;gt;0) | stats values(LRTrans)&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jul 2020 23:54:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filtering-values-within-JSON-searching/m-p/511664#M143463</guid>
      <dc:creator>Rodrigo_Larios</dc:creator>
      <dc:date>2020-07-29T23:54:50Z</dc:date>
    </item>
  </channel>
</rss>

