<?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: Kafka regex: Why is the command not working in Splunk search? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Kafka-regex-Why-is-the-command-not-working-in-Splunk-search/m-p/401580#M116229</link>
    <description>&lt;P&gt;The amx value is showing continuesly and the total_lag is showing the same repeated value for each lag and partition_name&lt;/P&gt;

&lt;P&gt;I want this &lt;BR /&gt;
Topic_name total_lag partition_number lag&lt;BR /&gt;
amx                240.                  0.                     20&lt;BR /&gt;
                                                  1.                    30&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 20:08:25 GMT</pubDate>
    <dc:creator>pswalia06</dc:creator>
    <dc:date>2020-09-29T20:08:25Z</dc:date>
    <item>
      <title>Kafka regex: Why is the command not working in Splunk search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Kafka-regex-Why-is-the-command-not-working-in-Splunk-search/m-p/401578#M116227</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;{"topic": "amx", "total_lag": 2670, "partitions": [{"lag": 117, "partition_number": 0}, {"lag": 122, "partition_number": 1}, {"lag": 130, "partition_number": 2}, {"lag": 130, "partition_number": 3}, {"lag": 148, "partition_number": 4}, {"lag": 144, "partition_number": 5}, {"lag": 158, "partition_number": 6}, {"lag": 130, "partition_number": 7}, {"lag": 123, "partition_number": 8}, {"lag": 145, "partition_number": 9}, {"lag": 130, "partition_number": 10}, {"lag": 127, "partition_number": 11}, {"lag": 123, "partition_number": 12}, {"lag": 121, "partition_number": 13}, {"lag": 118, "partition_number": 14}, {"lag": 125, "partition_number": 15}, {"lag": 133, "partition_number": 16}, {"lag": 161, "partition_number": 17}, {"lag": 134, "partition_number": 18}, {"lag": 151, "partition_number": 19}]}


index=orion-platform  source="/opt/bda/logs/kafkalag.log" |spath output=AA path=counterList{1} | rex field=AA "\"lag\":\s(?.\w+)\,\s\"partition_number\"\:\s(?\d+)\}" max_match=100 | table State1,partition_number
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Above command not working in splunk search.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jun 2018 14:54:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Kafka-regex-Why-is-the-command-not-working-in-Splunk-search/m-p/401578#M116227</guid>
      <dc:creator>pswalia06</dc:creator>
      <dc:date>2018-06-22T14:54:33Z</dc:date>
    </item>
    <item>
      <title>Re: Kafka regex: Why is the command not working in Splunk search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Kafka-regex-Why-is-the-command-not-working-in-Splunk-search/m-p/401579#M116228</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;Can you please try the following search?  I haven't used any regular expression but it will give you all the data from JSON event.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;YOUR_SEARCH |
| rename partitions{}.lag as lag, partitions{}.partition_number as partition_number
| eval temp = mvzip(lag,partition_number) | stats count by _time total_lag,topic,temp
| eval lag = mvindex(split(temp,","),0) ,partition_number=mvindex(split(temp,","),1) | table topic total_lag lag partition_number
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;My Sample Search:&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval _raw="{\"topic\": \"amx\", \"total_lag\": 2670, \"partitions\": [{\"lag\": 117, \"partition_number\": 0}, {\"lag\": 122, \"partition_number\": 1}, {\"lag\": 130, \"partition_number\": 2}, {\"lag\": 130, \"partition_number\": 3}, {\"lag\": 148, \"partition_number\": 4}, {\"lag\": 144, \"partition_number\": 5}, {\"lag\": 158, \"partition_number\": 6}, {\"lag\": 130, \"partition_number\": 7}, {\"lag\": 123, \"partition_number\": 8}, {\"lag\": 145, \"partition_number\": 9}, {\"lag\": 130, \"partition_number\": 10}, {\"lag\": 127, \"partition_number\": 11}, {\"lag\": 123, \"partition_number\": 12}, {\"lag\": 121, \"partition_number\": 13}, {\"lag\": 118, \"partition_number\": 14}, {\"lag\": 125, \"partition_number\": 15}, {\"lag\": 133, \"partition_number\": 16}, {\"lag\": 161, \"partition_number\": 17}, {\"lag\": 134, \"partition_number\": 18}, {\"lag\": 151, \"partition_number\": 19}]}" 
| kv
| rename partitions{}.lag as lag, partitions{}.partition_number as partition_number
| eval temp = mvzip(lag,partition_number) | stats count by _time total_lag,topic,temp
| eval lag = mvindex(split(temp,","),0) ,partition_number=mvindex(split(temp,","),1) | table topic total_lag lag partition_number
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Please let me know if assistance required.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jun 2018 15:52:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Kafka-regex-Why-is-the-command-not-working-in-Splunk-search/m-p/401579#M116228</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2018-06-22T15:52:22Z</dc:date>
    </item>
    <item>
      <title>Re: Kafka regex: Why is the command not working in Splunk search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Kafka-regex-Why-is-the-command-not-working-in-Splunk-search/m-p/401580#M116229</link>
      <description>&lt;P&gt;The amx value is showing continuesly and the total_lag is showing the same repeated value for each lag and partition_name&lt;/P&gt;

&lt;P&gt;I want this &lt;BR /&gt;
Topic_name total_lag partition_number lag&lt;BR /&gt;
amx                240.                  0.                     20&lt;BR /&gt;
                                                  1.                    30&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 20:08:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Kafka-regex-Why-is-the-command-not-working-in-Splunk-search/m-p/401580#M116229</guid>
      <dc:creator>pswalia06</dc:creator>
      <dc:date>2020-09-29T20:08:25Z</dc:date>
    </item>
    <item>
      <title>Re: Kafka regex: Why is the command not working in Splunk search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Kafka-regex-Why-is-the-command-not-working-in-Splunk-search/m-p/401581#M116230</link>
      <description>&lt;P&gt;@pswalia06&lt;/P&gt;

&lt;P&gt;Are you looking for this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval _raw="{\"topic\": \"amx\", \"total_lag\": 2670, \"partitions\": [{\"lag\": 117, \"partition_number\": 0}, {\"lag\": 122, \"partition_number\": 1}, {\"lag\": 130, \"partition_number\": 2}, {\"lag\": 130, \"partition_number\": 3}, {\"lag\": 148, \"partition_number\": 4}, {\"lag\": 144, \"partition_number\": 5}, {\"lag\": 158, \"partition_number\": 6}, {\"lag\": 130, \"partition_number\": 7}, {\"lag\": 123, \"partition_number\": 8}, {\"lag\": 145, \"partition_number\": 9}, {\"lag\": 130, \"partition_number\": 10}, {\"lag\": 127, \"partition_number\": 11}, {\"lag\": 123, \"partition_number\": 12}, {\"lag\": 121, \"partition_number\": 13}, {\"lag\": 118, \"partition_number\": 14}, {\"lag\": 125, \"partition_number\": 15}, {\"lag\": 133, \"partition_number\": 16}, {\"lag\": 161, \"partition_number\": 17}, {\"lag\": 134, \"partition_number\": 18}, {\"lag\": 151, \"partition_number\": 19}]}" 
| kv
| rename partitions{}.lag as lag, partitions{}.partition_number as partition_number
| table topic total_lag  partition_number lag
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 22 Jun 2018 16:58:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Kafka-regex-Why-is-the-command-not-working-in-Splunk-search/m-p/401581#M116230</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2018-06-22T16:58:42Z</dc:date>
    </item>
    <item>
      <title>Re: Kafka regex: Why is the command not working in Splunk search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Kafka-regex-Why-is-the-command-not-working-in-Splunk-search/m-p/401582#M116231</link>
      <description>&lt;P&gt;Is there a way to convert this feed to a json format? It's pretty close....&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jun 2018 18:31:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Kafka-regex-Why-is-the-command-not-working-in-Splunk-search/m-p/401582#M116231</guid>
      <dc:creator>ddrillic</dc:creator>
      <dc:date>2018-06-22T18:31:34Z</dc:date>
    </item>
    <item>
      <title>Re: Kafka regex: Why is the command not working in Splunk search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Kafka-regex-Why-is-the-command-not-working-in-Splunk-search/m-p/401583#M116232</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/5261i38E2D5D0BC1A1C98/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Here i have one more problem. If you see the below table topic name it is amx and amx1 but when i do line charts instead of showing two lines one for amx and one for amx1 it is showing only one line. How can we separate them?&lt;/P&gt;</description>
      <pubDate>Sat, 23 Jun 2018 01:28:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Kafka-regex-Why-is-the-command-not-working-in-Splunk-search/m-p/401583#M116232</guid>
      <dc:creator>pswalia06</dc:creator>
      <dc:date>2018-06-23T01:28:01Z</dc:date>
    </item>
    <item>
      <title>Re: Kafka regex: Why is the command not working in Splunk search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Kafka-regex-Why-is-the-command-not-working-in-Splunk-search/m-p/401584#M116233</link>
      <description>&lt;P&gt;it is json format only&lt;/P&gt;</description>
      <pubDate>Sun, 24 Jun 2018 05:00:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Kafka-regex-Why-is-the-command-not-working-in-Splunk-search/m-p/401584#M116233</guid>
      <dc:creator>pswalia06</dc:creator>
      <dc:date>2018-06-24T05:00:27Z</dc:date>
    </item>
    <item>
      <title>Re: Kafka regex: Why is the command not working in Splunk search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Kafka-regex-Why-is-the-command-not-working-in-Splunk-search/m-p/401585#M116234</link>
      <description>&lt;P&gt;HI &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/107560"&gt;@pswalia06&lt;/a&gt;,&lt;/P&gt;

&lt;P&gt;Can you please try the following search?&lt;/P&gt;

&lt;P&gt;YOUR_SEARCH&lt;BR /&gt;
|kv&lt;BR /&gt;
| rename partitions{}.lag as lag, partitions{}.partition_number as partition_number&lt;BR /&gt;
| timechart latest(total_lag) as total_lag by topic&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 20:08:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Kafka-regex-Why-is-the-command-not-working-in-Splunk-search/m-p/401585#M116234</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2020-09-29T20:08:52Z</dc:date>
    </item>
  </channel>
</rss>

