<?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 Finding Unique Pairs of Data in Interchangeable Fields in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Finding-Unique-Pairs-of-Data-in-Interchangeable-Fields/m-p/348246#M103123</link>
    <description>&lt;P&gt;Hi folks, I'm parsing Cisco Callmanager call detail records in our splunk system and I'd like to see which pairs of telephone numbers have the most calls between them, but here's the tricky bit: I don't care who called who, I want to aggregate calls from A-&amp;gt;B and B-&amp;gt;A into one counter and list the top 10 pairs of callers who make the most calls to each other.&lt;/P&gt;

&lt;P&gt;The code below is giving me a nice list of top calling pairs at the moment, but A-&amp;gt;B and B-&amp;gt;A are listed as two distinct pairs, how do I aggregate them?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=cucm | stats count by callingPartyNumber,finalCalledPartyNumber |sort by -count
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 01 Nov 2017 16:25:06 GMT</pubDate>
    <dc:creator>lboro_garyp</dc:creator>
    <dc:date>2017-11-01T16:25:06Z</dc:date>
    <item>
      <title>Finding Unique Pairs of Data in Interchangeable Fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Finding-Unique-Pairs-of-Data-in-Interchangeable-Fields/m-p/348246#M103123</link>
      <description>&lt;P&gt;Hi folks, I'm parsing Cisco Callmanager call detail records in our splunk system and I'd like to see which pairs of telephone numbers have the most calls between them, but here's the tricky bit: I don't care who called who, I want to aggregate calls from A-&amp;gt;B and B-&amp;gt;A into one counter and list the top 10 pairs of callers who make the most calls to each other.&lt;/P&gt;

&lt;P&gt;The code below is giving me a nice list of top calling pairs at the moment, but A-&amp;gt;B and B-&amp;gt;A are listed as two distinct pairs, how do I aggregate them?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=cucm | stats count by callingPartyNumber,finalCalledPartyNumber |sort by -count
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 01 Nov 2017 16:25:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Finding-Unique-Pairs-of-Data-in-Interchangeable-Fields/m-p/348246#M103123</guid>
      <dc:creator>lboro_garyp</dc:creator>
      <dc:date>2017-11-01T16:25:06Z</dc:date>
    </item>
    <item>
      <title>Re: Finding Unique Pairs of Data in Interchangeable Fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Finding-Unique-Pairs-of-Data-in-Interchangeable-Fields/m-p/348247#M103124</link>
      <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=cucm 
| eval callParticipents=mvsort(split(callingPartyNumber."#".finalCalledPartyNumber,"#") | nomv callParticipents| stats count by callParticipents |sort by -count
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 01 Nov 2017 16:45:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Finding-Unique-Pairs-of-Data-in-Interchangeable-Fields/m-p/348247#M103124</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-11-01T16:45:37Z</dc:date>
    </item>
    <item>
      <title>Re: Finding Unique Pairs of Data in Interchangeable Fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Finding-Unique-Pairs-of-Data-in-Interchangeable-Fields/m-p/348248#M103125</link>
      <description>&lt;P&gt;Brilliant! It was missing a bracket but did the trick once I popped it back in &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;The most important part seems to be&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eval callParticipents=mvsort(split(callingPartyNumber."#".finalCalledPartyNumber,"#"))
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;...but I can't quite figure it out, could you explain it, please? I get that we're creating a new multivalue field to work with called callParticipents for each event in the timeframe. I guess it doesn't matter which order the values go into the field A/B is the same as B/A for the purposes of a multivalue field, right? I just can't grok how callParticipents is built from that line&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;edit&lt;/EM&gt;&lt;/P&gt;

&lt;P&gt;Never mind, I sat down and read the docs on split and the mv commands and I get it now. Thanks so much!&lt;/P&gt;</description>
      <pubDate>Wed, 01 Nov 2017 18:07:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Finding-Unique-Pairs-of-Data-in-Interchangeable-Fields/m-p/348248#M103125</guid>
      <dc:creator>lboro_garyp</dc:creator>
      <dc:date>2017-11-01T18:07:04Z</dc:date>
    </item>
  </channel>
</rss>

