<?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: Summarizing postfix logs in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Summarizing-postfix-logs/m-p/586427#M204283</link>
    <description>&lt;P&gt;OK. It seems I can do I thought about streamstats but for that I think I'd have to re-sort "backwards" time-wise - another not very best idea.&lt;/P&gt;</description>
    <pubDate>Thu, 24 Feb 2022 14:40:16 GMT</pubDate>
    <dc:creator>PickleRick</dc:creator>
    <dc:date>2022-02-24T14:40:16Z</dc:date>
    <item>
      <title>Summarizing postfix logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Summarizing-postfix-logs/m-p/586424#M204282</link>
      <description>&lt;P&gt;I'm not that bad in searching &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; but this case is a little over my head and I need some clever idea.&lt;/P&gt;&lt;P&gt;I have postfix logs. They have three types of events. All events have &lt;EM&gt;queue_id&lt;/EM&gt; field which identifies the message. The events have either &lt;EM&gt;from, to &lt;/EM&gt;or (&lt;EM&gt;to&lt;/EM&gt; and &lt;EM&gt;orig_to&lt;/EM&gt;) fields set.&lt;/P&gt;&lt;P&gt;I want to do&lt;/P&gt;&lt;PRE&gt;stats values(from) by to orig_to&lt;/PRE&gt;&lt;P&gt;The problem is that the fields are in separate events. And both methods of joining them together are faulted in one way or another.&lt;/P&gt;&lt;P&gt;If I do&lt;/P&gt;&lt;PRE&gt;eventstats values(from) by queue_id&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;I get the desired result but if I search over a longer timespan I'm hitting a memory limit. Sure, I can raise the limit in the config but it would be a better solution to find a more reasonable search for it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If I try to do&lt;/P&gt;&lt;PRE&gt;transaction queue_id&lt;/PRE&gt;&lt;P&gt;Of course everthing works but the transaction joins the to and orig_to fields into multivalued fields and there is no reliable way to "unjoin" them (over one transaction you can have more &lt;EM&gt;to&lt;/EM&gt; values than &lt;EM&gt;orig_to&lt;/EM&gt; and you can't simply do mapping between the values).&lt;/P&gt;&lt;P&gt;So I'm a little stuck how to transform my data to get &lt;EM&gt;from, to, orig_to&lt;/EM&gt; tuples so I can later pass it to stats.&lt;/P&gt;&lt;P&gt;Any hints?&lt;/P&gt;&lt;P&gt;Of course, if nothing works I'll simply raise the limits and do eventstats but it's not a pretty solution.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Feb 2022 14:27:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Summarizing-postfix-logs/m-p/586424#M204282</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2022-02-24T14:27:38Z</dc:date>
    </item>
    <item>
      <title>Re: Summarizing postfix logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Summarizing-postfix-logs/m-p/586427#M204283</link>
      <description>&lt;P&gt;OK. It seems I can do I thought about streamstats but for that I think I'd have to re-sort "backwards" time-wise - another not very best idea.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Feb 2022 14:40:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Summarizing-postfix-logs/m-p/586427#M204283</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2022-02-24T14:40:16Z</dc:date>
    </item>
    <item>
      <title>Re: Summarizing postfix logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Summarizing-postfix-logs/m-p/586586#M204324</link>
      <description>&lt;P&gt;I must have missed something here. &amp;nbsp;The standard way to join these field is just values(*) as * by unique ID. &amp;nbsp;Does it apply?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| fields from to orig_to queue_id
| stats values(*) as * by queue_id
| stats values(from) by to orig_to&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;(BTW, I am curious about the semantic significance of the number. &amp;nbsp;Appreciate an elaboration.)&lt;/P&gt;</description>
      <pubDate>Fri, 25 Feb 2022 11:10:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Summarizing-postfix-logs/m-p/586586#M204324</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-02-25T11:10:21Z</dc:date>
    </item>
    <item>
      <title>Re: Summarizing postfix logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Summarizing-postfix-logs/m-p/586595#M204326</link>
      <description>&lt;P&gt;The problem is that if I aggregate by values(*), I'll get all to and orig_to values but I lose the connection between them.&lt;/P&gt;&lt;P&gt;Let's say I have it like (different events, same queue_id):&lt;/P&gt;&lt;P&gt;from: a@b.c&lt;BR /&gt;to: c@d.e&lt;BR /&gt;to: e@f.g, orig_to: g@h.i&lt;/P&gt;&lt;P&gt;After values(to) I wouldn't know which of them relates to the orig_to that we know.&lt;/P&gt;&lt;P&gt;But it seems sorting by time and streamstatsing does the job.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Feb 2022 12:34:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Summarizing-postfix-logs/m-p/586595#M204326</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2022-02-25T12:34:37Z</dc:date>
    </item>
    <item>
      <title>Re: Summarizing postfix logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Summarizing-postfix-logs/m-p/586606#M204332</link>
      <description>&lt;P&gt;Not a very elegant idea but it seems to work quite OK (and it doesn't exceed the limits).&lt;/P&gt;&lt;PRE&gt;index=postfix (some_additional_limiting_conditions) (to=* OR from=* OR orig_to=*)&lt;BR /&gt;| fields queue_id to from orig_to _time&lt;BR /&gt;| sort 0 _time&lt;BR /&gt;| streamstats current=t window=100 values(from) as from by queue_id&lt;BR /&gt;| stats values(from) as from latest(_time) as _time by to orig_to&lt;/PRE&gt;&lt;P&gt;That's pretty much what I needed all along &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Feb 2022 14:22:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Summarizing-postfix-logs/m-p/586606#M204332</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2022-02-25T14:22:18Z</dc:date>
    </item>
  </channel>
</rss>

