<?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: Combine data from same field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-data-from-same-field/m-p/633521#M220058</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/254521"&gt;@ag_yeck&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;If I understand what you are trying to do correctly, you just need to define a new field (using a regex command for this is good) to group your results by in the timechart statement.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;source="partners-api-ol" request_path_in_request="/v*" &lt;BR /&gt;| rex field=request_path_in_request "(?&amp;lt;request_root_path&amp;gt;^(?:\/\w+){1,3})"&lt;BR /&gt;| timechart count BY request_root_path useother=f limit=10&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;The regex is pulling out the first / delimited segments, up to levels 3 deep, and assigning this the field name&amp;nbsp;request_root_path.&amp;nbsp; This can then be used to group summarise the counts in timechart.&lt;BR /&gt;&lt;BR /&gt;Hope this helps&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 07 Mar 2023 03:08:56 GMT</pubDate>
    <dc:creator>yeahnah</dc:creator>
    <dc:date>2023-03-07T03:08:56Z</dc:date>
    <item>
      <title>How to combine data from same field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-data-from-same-field/m-p/633519#M220057</link>
      <description>&lt;P&gt;I am looking to chart a field that contains a request path but want to display and get a total count of all events that contain the root request path(a) and events that contain the root + &amp;lt;some guid&amp;gt;/contents.(b) The path is a field I manually extracted called "request_path_in_request"&lt;BR /&gt;Example of the path I want to combine in the cart:&lt;BR /&gt;(a)path=/v4/layers/asPlanted&lt;/P&gt;
&lt;P&gt;(b)path=/v4/layers/asPlanted&amp;lt;some guid&amp;gt;/contents&lt;/P&gt;
&lt;P&gt;Here is my Splunk query so far:&lt;BR /&gt;source="partners-api-ol" request_path_in_request="/v*" | timechart count by request_path_in_request useother=f limit=10&lt;/P&gt;
&lt;P&gt;And here is how that field is getting charted:&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="graph.png" style="width: 456px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/24222i621F3DE63567170A/image-size/large?v=v2&amp;amp;px=999" role="button" title="graph.png" alt="graph.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Is there a way to show only category of "/v4/layers/asPlanted" , but have the count be the total of all the events with that root path?&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2023 18:48:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-data-from-same-field/m-p/633519#M220057</guid>
      <dc:creator>ag_yeck</dc:creator>
      <dc:date>2023-03-07T18:48:37Z</dc:date>
    </item>
    <item>
      <title>Re: Combine data from same field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-data-from-same-field/m-p/633521#M220058</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/254521"&gt;@ag_yeck&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;If I understand what you are trying to do correctly, you just need to define a new field (using a regex command for this is good) to group your results by in the timechart statement.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;source="partners-api-ol" request_path_in_request="/v*" &lt;BR /&gt;| rex field=request_path_in_request "(?&amp;lt;request_root_path&amp;gt;^(?:\/\w+){1,3})"&lt;BR /&gt;| timechart count BY request_root_path useother=f limit=10&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;The regex is pulling out the first / delimited segments, up to levels 3 deep, and assigning this the field name&amp;nbsp;request_root_path.&amp;nbsp; This can then be used to group summarise the counts in timechart.&lt;BR /&gt;&lt;BR /&gt;Hope this helps&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2023 03:08:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-data-from-same-field/m-p/633521#M220058</guid>
      <dc:creator>yeahnah</dc:creator>
      <dc:date>2023-03-07T03:08:56Z</dc:date>
    </item>
    <item>
      <title>Re: Combine data from same field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-data-from-same-field/m-p/633602#M220070</link>
      <description>&lt;P&gt;This is a less expensive and more semantic method using &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/MultivalueEvalFunctions#split.28.26lt.3Bstr.26gt.3B.2C.26lt.3Bdelim.26gt.3B.29" target="_blank" rel="noopener"&gt;split&lt;/A&gt; and &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/MultivalueEvalFunctions#mvindex.28.26lt.3Bmv.26gt.3B.2C.26lt.3Bstart.26gt.3B.2C.26lt.3Bend.26gt.3B.29" target="_blank" rel="noopener"&gt;mvindex&lt;/A&gt;.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;source="partners-api-ol" request_path_in_request="/v*" | timechart count by request_path_in_request useother=f limit=10
| eval request_path_in_request = split(request_path_in_request, "/")
| eval rootpath = mvjoin(mvindex(request_path_in_request, 0,3), "/")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2023 16:50:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-data-from-same-field/m-p/633602#M220070</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-03-07T16:50:11Z</dc:date>
    </item>
    <item>
      <title>Re: Combine data from same field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-data-from-same-field/m-p/633616#M220073</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/158935"&gt;@yeahnah&lt;/a&gt;&amp;nbsp;, that worked! I am a Splunk noob so having the explanation after the solution is very helpful.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2023 17:45:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-data-from-same-field/m-p/633616#M220073</guid>
      <dc:creator>ag_yeck</dc:creator>
      <dc:date>2023-03-07T17:45:30Z</dc:date>
    </item>
    <item>
      <title>Re: Combine data from same field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-data-from-same-field/m-p/633617#M220074</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/33901"&gt;@yuanliu&lt;/a&gt;&amp;nbsp; I like the idea of just using semantics to solve, but this did not change the visualization. Maybe I need to use "rootpath" on the "timechart" line?&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2023 17:47:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-data-from-same-field/m-p/633617#M220074</guid>
      <dc:creator>ag_yeck</dc:creator>
      <dc:date>2023-03-07T17:47:45Z</dc:date>
    </item>
    <item>
      <title>Re: Combine data from same field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-data-from-same-field/m-p/633682#M220103</link>
      <description>&lt;P&gt;Yes, that's the idea. &amp;nbsp;If you want to use request_path_in_request as you orginally do, you can do&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval request_path_in_request = mvjoin(mvindex(request_path_in_request, 0,3), "/")&lt;/LI-CODE&gt;&lt;P&gt;But doing so would be less semantic. &amp;nbsp;Personally, I often assign modified values back to original field name. &amp;nbsp;But that's only when the modification do not considerably alter the semantic meaning of the original field name. (I did use&amp;nbsp;&lt;FONT face="andale mono,times"&gt;| eval request_path_in_request = split(request_path_in_request, "/")&lt;/FONT&gt;&amp;nbsp;in my illustration.)&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2023 07:38:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-data-from-same-field/m-p/633682#M220103</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-03-08T07:38:39Z</dc:date>
    </item>
  </channel>
</rss>

