<?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: Can I concatenate the arguments contained in Linux auditd &amp;quot;EXECVE&amp;quot; events? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Can-I-concatenate-the-arguments-contained-in-Linux-auditd-quot/m-p/424152#M167092</link>
    <description>&lt;P&gt;@johnvr,&lt;BR /&gt;
I just tried with your above examples and it works for me &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    | makeresults |eval data="argc=2 a0=df a1=-iP,argc=3 a0=sh a1=-c a2=rpm -qp --queryformat '%{NAME} %{VERSION}-%{RELEASE}\012' /tmp/prod-lti-number.x86_64.rpm"
    |makemv data delim=","|mvexpand data
    |rex field=data "argc=\d+\s+(?&amp;lt;total_argument&amp;gt;.+)$"|rex field=total_argument mode=sed "s/a\d+=//g"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 19 Oct 2018 13:57:25 GMT</pubDate>
    <dc:creator>renjith_nair</dc:creator>
    <dc:date>2018-10-19T13:57:25Z</dc:date>
    <item>
      <title>Can I concatenate the arguments contained in Linux auditd "EXECVE" events?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-concatenate-the-arguments-contained-in-Linux-auditd-quot/m-p/424143#M167083</link>
      <description>&lt;P&gt;For example, a standard EXECVE event in my environment will appear as: &lt;/P&gt;

&lt;P&gt;type=EXECVE msg=audit($something$) : arg=3 a0=systemctl a1=status a2=auditd.service&lt;/P&gt;

&lt;P&gt;I'm attempting to concatenate those so that, in every event, I'll end up with a field, call it "total_argument" where the value in the above circumstance will be "systemctl status auditd.service"&lt;/P&gt;

&lt;P&gt;The catch is, the argument number will obviously vary from event to event, and vary wildly - this means a simple eval to add a0, a1, and a2 would work only for the messages that only have 3 arguments.&lt;/P&gt;

&lt;P&gt;I'm looking for a way to accomplish this that would concatenate those values regardless of how many arguments the event would have.&lt;/P&gt;

&lt;P&gt;Is there a way to accomplish this in Splunk? &lt;/P&gt;</description>
      <pubDate>Thu, 11 Oct 2018 23:03:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-concatenate-the-arguments-contained-in-Linux-auditd-quot/m-p/424143#M167083</guid>
      <dc:creator>johnvr</dc:creator>
      <dc:date>2018-10-11T23:03:09Z</dc:date>
    </item>
    <item>
      <title>Re: Can I concatenate the arguments contained in Linux auditd "EXECVE" events?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-concatenate-the-arguments-contained-in-Linux-auditd-quot/m-p/424144#M167084</link>
      <description>&lt;P&gt;@johnvr , does this argument has a common pattern in the names to distinguish from other fields?&lt;/P&gt;</description>
      <pubDate>Fri, 12 Oct 2018 01:53:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-concatenate-the-arguments-contained-in-Linux-auditd-quot/m-p/424144#M167084</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-10-12T01:53:02Z</dc:date>
    </item>
    <item>
      <title>Re: Can I concatenate the arguments contained in Linux auditd "EXECVE" events?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-concatenate-the-arguments-contained-in-Linux-auditd-quot/m-p/424145#M167085</link>
      <description>&lt;P&gt;If I understand what you're asking, the answer is yes. It's always a+digit. a0, a1, a2, etc.&lt;/P&gt;

&lt;P&gt;In some cases, I've seen this get into the 100s.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Oct 2018 22:42:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-concatenate-the-arguments-contained-in-Linux-auditd-quot/m-p/424145#M167085</guid>
      <dc:creator>johnvr</dc:creator>
      <dc:date>2018-10-12T22:42:11Z</dc:date>
    </item>
    <item>
      <title>Re: Can I concatenate the arguments contained in Linux auditd "EXECVE" events?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-concatenate-the-arguments-contained-in-Linux-auditd-quot/m-p/424146#M167086</link>
      <description>&lt;P&gt;@johnvr ,&lt;/P&gt;

&lt;P&gt;Try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|eval total_argument=""|foreach a* [eval total_argument=if(match("&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;","a[0-9].*"),total_argument." ".&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;,total_argument) ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Sample search used,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|makeresults |eval type="EXECVE", msg="audit", arg=3, a0="systemctl", a1="status", a2="auditd.service"|eval total_argument=""
|foreach a* [eval total_argument=if(match("&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;","a[0-9].*"),total_argument." ".&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;,total_argument) ]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 12 Oct 2018 23:54:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-concatenate-the-arguments-contained-in-Linux-auditd-quot/m-p/424146#M167086</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-10-12T23:54:40Z</dc:date>
    </item>
    <item>
      <title>Re: Can I concatenate the arguments contained in Linux auditd "EXECVE" events?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-concatenate-the-arguments-contained-in-Linux-auditd-quot/m-p/424147#M167087</link>
      <description>&lt;P&gt;That works! Well, in some cases. In others, not. Investigating. Would this work in props.conf as an eval, or would it have to be an extraction, or...?&lt;/P&gt;

&lt;P&gt;index=auditd type=EXECVE, the argc (the count) field is represented in about 96% of events, but that's only working in about 30%.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Oct 2018 17:56:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-concatenate-the-arguments-contained-in-Linux-auditd-quot/m-p/424147#M167087</guid>
      <dc:creator>johnvr</dc:creator>
      <dc:date>2018-10-15T17:56:02Z</dc:date>
    </item>
    <item>
      <title>Re: Can I concatenate the arguments contained in Linux auditd "EXECVE" events?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-concatenate-the-arguments-contained-in-Linux-auditd-quot/m-p/424148#M167088</link>
      <description>&lt;P&gt;@johnvr , i missed the initialization part eval total_argument="" in the search though its mentioned in the sample search. Updated the answer now. Would be interested to know which case its not working. I doubt the foreacch in props. Instead you can try below also&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|rex field=_raw "arg=\d+\s+(?&amp;lt;total_argument&amp;gt;.+)$"|rex field=total_argument mode=sed "s/a\d+=//g"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 16 Oct 2018 13:24:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-concatenate-the-arguments-contained-in-Linux-auditd-quot/m-p/424148#M167088</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-10-16T13:24:01Z</dc:date>
    </item>
    <item>
      <title>Re: Can I concatenate the arguments contained in Linux auditd "EXECVE" events?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-concatenate-the-arguments-contained-in-Linux-auditd-quot/m-p/424149#M167089</link>
      <description>&lt;P&gt;Getting much better results with the RegEx.&lt;/P&gt;

&lt;P&gt;About 70% get parsed.&lt;/P&gt;

&lt;P&gt;A couple examples that don't... (the second example makes sense b/c spaces are included in the argument)... I'll mess with this, but let me know if you've got any updates. One thing I've noticed... these EXECVE events end with the final argument. So "$" may be relevant somewhere.&lt;/P&gt;

&lt;P&gt;argc=2 a0=df a1=-iP &lt;/P&gt;

&lt;P&gt;argc=3 a0=sh a1=-c a2=rpm -qp --queryformat '%{NAME} %{VERSION}-%{RELEASE}\012' /tmp/prod-lti-number.x86_64.rpm &lt;/P&gt;</description>
      <pubDate>Thu, 18 Oct 2018 19:06:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-concatenate-the-arguments-contained-in-Linux-auditd-quot/m-p/424149#M167089</guid>
      <dc:creator>johnvr</dc:creator>
      <dc:date>2018-10-18T19:06:06Z</dc:date>
    </item>
    <item>
      <title>Re: Can I concatenate the arguments contained in Linux auditd "EXECVE" events?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-concatenate-the-arguments-contained-in-Linux-auditd-quot/m-p/424150#M167090</link>
      <description>&lt;P&gt;I'll add that these fields are just being parsed via KV_Mode, which might be part of the problem. It's breaking arguments that have spaces. Therefore, I may need to turn KV_Mode to none, and try regular regex extractions.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 21:39:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-concatenate-the-arguments-contained-in-Linux-auditd-quot/m-p/424150#M167090</guid>
      <dc:creator>johnvr</dc:creator>
      <dc:date>2020-09-29T21:39:06Z</dc:date>
    </item>
    <item>
      <title>Re: Can I concatenate the arguments contained in Linux auditd "EXECVE" events?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-concatenate-the-arguments-contained-in-Linux-auditd-quot/m-p/424151#M167091</link>
      <description>&lt;P&gt;Then again... if I push everything to regular regex extractions, I'm going to have to account for any # of arguments... hm...&lt;/P&gt;</description>
      <pubDate>Thu, 18 Oct 2018 19:20:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-concatenate-the-arguments-contained-in-Linux-auditd-quot/m-p/424151#M167091</guid>
      <dc:creator>johnvr</dc:creator>
      <dc:date>2018-10-18T19:20:51Z</dc:date>
    </item>
    <item>
      <title>Re: Can I concatenate the arguments contained in Linux auditd "EXECVE" events?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-concatenate-the-arguments-contained-in-Linux-auditd-quot/m-p/424152#M167092</link>
      <description>&lt;P&gt;@johnvr,&lt;BR /&gt;
I just tried with your above examples and it works for me &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    | makeresults |eval data="argc=2 a0=df a1=-iP,argc=3 a0=sh a1=-c a2=rpm -qp --queryformat '%{NAME} %{VERSION}-%{RELEASE}\012' /tmp/prod-lti-number.x86_64.rpm"
    |makemv data delim=","|mvexpand data
    |rex field=data "argc=\d+\s+(?&amp;lt;total_argument&amp;gt;.+)$"|rex field=total_argument mode=sed "s/a\d+=//g"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 19 Oct 2018 13:57:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-concatenate-the-arguments-contained-in-Linux-auditd-quot/m-p/424152#M167092</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-10-19T13:57:25Z</dc:date>
    </item>
  </channel>
</rss>

