<?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: Display specific field in log by count in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Display-specific-field-in-log-by-count/m-p/692172#M235628</link>
    <description>&lt;P&gt;What is your full search?&lt;/P&gt;</description>
    <pubDate>Tue, 02 Jul 2024 07:03:56 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2024-07-02T07:03:56Z</dc:date>
    <item>
      <title>Display specific field in log by count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-specific-field-in-log-by-count/m-p/692143#M235616</link>
      <description>&lt;P&gt;I want to write the query which will number of count the event occurred and time taken for that.&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the log&amp;nbsp; -&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;log&lt;/SPAN&gt;&lt;SPAN&gt;:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;2024-07-01 16:57:17.022 INFO 1 --- [nio-8080-exec-6] xyztask : FILE_TRANSFER | Data | LOGS | Fetched count:345243 time:102445ms&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;time&lt;/SPAN&gt;&lt;SPAN&gt;:&amp;nbsp;&lt;/SPAN&gt;2024-07-01T16:57:17.022583728Z&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;I want result like -&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;| count&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| time |&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;|&amp;nbsp;2528945&amp;nbsp; &amp;nbsp; |&amp;nbsp;130444 |&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Query that I am writing&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;base search | stats count by count | stats count by time | table count time&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;For&amp;nbsp;&lt;SPAN class=""&gt; stats count by count I am getting error -&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Error in 'stats' command: The output field 'count' cannot have the same name as a group-by field&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Query isn't right, correct solution would be helpful. Also tried different queries different ways.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2024 18:10:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-specific-field-in-log-by-count/m-p/692143#M235616</guid>
      <dc:creator>Bhavika</dc:creator>
      <dc:date>2024-07-01T18:10:16Z</dc:date>
    </item>
    <item>
      <title>Re: Display specific field in log by count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-specific-field-in-log-by-count/m-p/692144#M235617</link>
      <description>&lt;P&gt;Is it just a case of extracting count and time from your event? If so, why are you using stats commands?&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2024 18:23:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-specific-field-in-log-by-count/m-p/692144#M235617</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-07-01T18:23:17Z</dc:date>
    </item>
    <item>
      <title>Re: Display specific field in log by count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-specific-field-in-log-by-count/m-p/692145#M235618</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp; Yes, just the extraction of count and time which is there in log. What is the correct way ? I am new to Splunk.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2024 18:26:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-specific-field-in-log-by-count/m-p/692145#M235618</guid>
      <dc:creator>Bhavika</dc:creator>
      <dc:date>2024-07-01T18:26:00Z</dc:date>
    </item>
    <item>
      <title>Re: Display specific field in log by count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-specific-field-in-log-by-count/m-p/692147#M235619</link>
      <description>&lt;P&gt;Probably the simplest (assuming the event you posted is an accurate representation of your events) is to use rex to extract the fields.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "count:(?&amp;lt;count&amp;gt;\d+) time:(?&amp;lt;time&amp;gt;\d+)ms"&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 01 Jul 2024 18:54:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-specific-field-in-log-by-count/m-p/692147#M235619</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-07-01T18:54:19Z</dc:date>
    </item>
    <item>
      <title>Re: Display specific field in log by count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-specific-field-in-log-by-count/m-p/692148#M235620</link>
      <description>&lt;P&gt;With stats command you can use the same field name in both the aggregation function (in your case you want a count of events which yields a field named just &lt;EM&gt;count&lt;/EM&gt;) and the list of fields by which you split the results (in your case &lt;EM&gt;count&lt;/EM&gt; is also a field name within the event.&lt;/P&gt;&lt;P&gt;You can walk around the problem by renaming the field. Like&lt;/P&gt;&lt;PRE&gt;| stats count as event_count by count&lt;/PRE&gt;&lt;P&gt;This way the count of events will not be named &lt;EM&gt;count&lt;/EM&gt; in the results but will be named &lt;EM&gt;event_count&lt;/EM&gt; whereas the field by which you split the results (which comes from your events) will stay named &lt;EM&gt;count&lt;/EM&gt;. Yes, it's a tiny bit confusing.&lt;/P&gt;&lt;P&gt;Anyway, I don't see what's the relation between your data and your desired results. And your final table command is completely unnecessary at this point - your results will just contain table of fields &lt;EM&gt;count&lt;/EM&gt; and &lt;EM&gt;time&lt;/EM&gt; after the last &lt;EM&gt;stats&lt;/EM&gt; command so the table command is not needed.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2024 19:28:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-specific-field-in-log-by-count/m-p/692148#M235620</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-07-01T19:28:07Z</dc:date>
    </item>
    <item>
      <title>Re: Display specific field in log by count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-specific-field-in-log-by-count/m-p/692162#M235624</link>
      <description>&lt;P&gt;This is generating logs and not the expected output.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2024 03:23:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-specific-field-in-log-by-count/m-p/692162#M235624</guid>
      <dc:creator>Bhavika</dc:creator>
      <dc:date>2024-07-02T03:23:22Z</dc:date>
    </item>
    <item>
      <title>Re: Display specific field in log by count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-specific-field-in-log-by-count/m-p/692164#M235625</link>
      <description>&lt;P&gt;rex just extracts the fields, now add&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| table count time&lt;/LI-CODE&gt;&lt;P&gt;if you want each event listed with the count and time.&lt;/P&gt;&lt;P&gt;If you want some other representation of those values, please say what you want&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2024 04:29:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-specific-field-in-log-by-count/m-p/692164#M235625</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2024-07-02T04:29:34Z</dc:date>
    </item>
    <item>
      <title>Re: Display specific field in log by count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-specific-field-in-log-by-count/m-p/692172#M235628</link>
      <description>&lt;P&gt;What is your full search?&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2024 07:03:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-specific-field-in-log-by-count/m-p/692172#M235628</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-07-02T07:03:56Z</dc:date>
    </item>
  </channel>
</rss>

