<?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: How to parse complete command line information into the event field ? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-complete-command-line-information-into-the-event/m-p/339163#M62589</link>
    <description>&lt;P&gt;Hi All, Can you please guide me on this, I had pushed the above props.conf file into the search head  via deployer but no luck still I could see only partial command information present in the command field. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; [linux_secure]
  ## Event extractions by type
  REPORT-0authentication_for_linux_secure = ssh-login-events, ssh-session-close, ssh-disconnect, sshd_authentication_kerberos_success, sshd_authentication_refused, sshd_authentication_tried
  REPORT-account_management_for_linux_secure = useradd, userdel
  REPORT-firewall = ipfw, ipfw-stealth, ipfw-icmp, pf
  REPORT-routing = iptables
  EXTRACT-command = "sudo:.*?COMMAND=(?[^;]+)(;|$)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;When I searched using the above regex its working, I could see the entire command information in command line.  But same when I added into the Props.conf for the sourcetype = linux_secure and pushed the changes in splunk it did not work, I am getting the partial command information in Command line field. &lt;/P&gt;

&lt;P&gt;Kindly guide me how to parse entire command line information in the command field.&lt;/P&gt;</description>
    <pubDate>Fri, 15 Dec 2017 13:21:38 GMT</pubDate>
    <dc:creator>Hemnaath</dc:creator>
    <dc:date>2017-12-15T13:21:38Z</dc:date>
    <item>
      <title>How to parse complete command line information into the event field ?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-complete-command-line-information-into-the-event/m-p/339153#M62579</link>
      <description>&lt;P&gt;Hi All,  Today we got an request from a user to include the entire information provided in the command line, when checked the values parsed for the COMMAND field, it only parses until there's a space.&lt;/P&gt;

&lt;P&gt;search query:  index=unix sourcetype=linux_secure COMMAND &lt;/P&gt;

&lt;P&gt;For example, this log: &lt;BR /&gt;
 Dec 12 15:02:17 test01 sudo: solarwinds : TTY=pts/1 ; PWD=/opt/solarwinds ; USER=root ; COMMAND=/opt/solarwinds/utilities/check_file.sh -e -f /var/log/audit/audit.log &lt;/P&gt;

&lt;P&gt;"Problem"- COMMAND is currently parsed as "/opt/solarwinds/utilities/check_file.sh" &lt;/P&gt;

&lt;P&gt;"Exact Requirement"- Want it parses as "/opt/solarwinds/utilities/check_file.sh -e -f /var/log/audit/audit.log" &lt;/P&gt;

&lt;P&gt;Details :&lt;BR /&gt;
Inputs.conf for monitoring stanza &lt;BR /&gt;
[monitor:///var/log]&lt;BR /&gt;
whitelist=(.log|log$|messages|.out)&lt;BR /&gt;
blacklist=(lastlog)&lt;BR /&gt;
index = unix&lt;BR /&gt;
disabled = 0&lt;/P&gt;

&lt;P&gt;Props.conf Details:&lt;BR /&gt;
[linux_secure]&lt;/P&gt;

&lt;H2&gt;Event extractions by type&lt;/H2&gt;

&lt;P&gt;REPORT-0authentication_for_linux_secure = ssh-login-events, ssh-session-close, ssh-disconnect, etc&lt;BR /&gt;
REPORT-routing = iptables&lt;/P&gt;

&lt;P&gt;Kindly guide me how to parse entire command line information in the command field. &lt;/P&gt;

&lt;P&gt;thanks in advance. &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 17:14:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-complete-command-line-information-into-the-event/m-p/339153#M62579</guid>
      <dc:creator>Hemnaath</dc:creator>
      <dc:date>2020-09-29T17:14:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to parse complete command line information into the event field ?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-complete-command-line-information-into-the-event/m-p/339154#M62580</link>
      <description>&lt;P&gt;Your transforms.conf details didn't come through.  Please edit your question to include it, and you may also want to use the code syntax to make it easier to read (using the 101010 button above the text input).&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2017 14:19:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-complete-command-line-information-into-the-event/m-p/339154#M62580</guid>
      <dc:creator>micahkemp</dc:creator>
      <dc:date>2017-12-13T14:19:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to parse complete command line information into the event field ?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-complete-command-line-information-into-the-event/m-p/339155#M62581</link>
      <description>&lt;P&gt;Hey micahkemp, thanks for your effort on this, I have updated the question with the Partial transforms.conf details.  I am not sure how to make use of the code syntax to easier to read using 101010 button.&lt;/P&gt;

&lt;P&gt;Kindly guide me on how to parsing issue.&lt;BR /&gt;
thanks in advance.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2017 15:21:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-complete-command-line-information-into-the-event/m-p/339155#M62581</guid>
      <dc:creator>Hemnaath</dc:creator>
      <dc:date>2017-12-13T15:21:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to parse complete command line information into the event field ?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-complete-command-line-information-into-the-event/m-p/339156#M62582</link>
      <description>&lt;P&gt;Add this line to your props.conf entry (assuming that file is getting deployed to your search head)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[linux_secure]
..other existing entries...
EXTRACT-command = COMMAND\=(?&amp;lt;COMMAND&amp;gt;.+)$
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;FYR, to format the code, you can either select the code and press Ctrl+K, or, as @micahkemp said, 101010 button above the text box.&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/3994i93F617DCE3B1EC05/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2017 15:48:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-complete-command-line-information-into-the-event/m-p/339156#M62582</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-12-13T15:48:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to parse complete command line information into the event field ?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-complete-command-line-information-into-the-event/m-p/339157#M62583</link>
      <description>&lt;P&gt;In order to fulfill this one, you are going to have to determine under what circumstances that &lt;CODE&gt;COMMAND=&lt;/CODE&gt; appears, so we can help you establish what kind of regex can pull out the correct value.  Is it only for sudo? is &lt;CODE&gt;COMMAND=&lt;/CODE&gt; always the last key value? Does the real value never include a semicolon?&lt;/P&gt;

&lt;P&gt;If so, then something like this should pull out what you need...  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | rex   "sudo:.*?COMMAND=(?&amp;lt;COMMAND&amp;gt;[^;]+)(;|$)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Test that, and if it works as desired, then we can help you figure out where to drop it into your config. &lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2017 15:58:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-complete-command-line-information-into-the-event/m-p/339157#M62583</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-12-13T15:58:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to parse complete command line information into the event field ?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-complete-command-line-information-into-the-event/m-p/339158#M62584</link>
      <description>&lt;P&gt;Hi Somesoni2, thanks for your effort on this,  hey props and transforms are placed in both indexer instances/ search head and inputs.conf is placed in the remote nodes.&lt;/P&gt;

&lt;P&gt;So I need to update it like this right in props.conf &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[linux_secure]

EXTRACT-command = COMMAND\=(?.+)$
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So shall I push the changes in both the indexer instance as well as search head master instances.&lt;BR /&gt;
Kindly guide me please.&lt;/P&gt;

&lt;P&gt;thanks in advance.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2017 16:04:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-complete-command-line-information-into-the-event/m-p/339158#M62584</guid>
      <dc:creator>Hemnaath</dc:creator>
      <dc:date>2017-12-13T16:04:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to parse complete command line information into the event field ?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-complete-command-line-information-into-the-event/m-p/339159#M62585</link>
      <description>&lt;P&gt;Based on configurations you've defined in props.conf and transforms.conf (Only search time field extraction related settings are present), they are not required to be deployed on Indexers. Go ahead and push it to Search Heads.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2017 16:08:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-complete-command-line-information-into-the-event/m-p/339159#M62585</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-12-13T16:08:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to parse complete command line information into the event field ?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-complete-command-line-information-into-the-event/m-p/339160#M62586</link>
      <description>&lt;P&gt;Hi Dal Jeanis, thanks for your effort on this, Just checked all the events which are getting populated when we execute the below query  and found that all the events are having SUDO. I have also tested the regex which you had posted above along with query and it works fine getting the complete command details in the command field.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;   index=unix sourcetype=linux_secure COMMAND | rex   "sudo:.*?COMMAND=(?&amp;lt;COMMAND&amp;gt;[^;]+)(;|$)"

Dec 14 15:00:21 test02 sudo: solarwinds : TTY=pts/3 ; PWD=/opt/solarwinds ; USER=root ; COMMAND=/opt/solarwinds/utilities/check_file.sh -e -f /var/log/audit/audit.log
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Can I push the below props.conf  in the search head cluster environment.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[linux_secure]
 ## Event extractions by type
 REPORT-0authentication_for_linux_secure = ssh-login-events, ssh-session-close, ssh-disconnect, etc
 EXTRACT-command = "sudo:.*?COMMAND=(?[^;]+)(;|$)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Kindly guide me on this.&lt;BR /&gt;
thanks in advance.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2017 15:25:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-complete-command-line-information-into-the-event/m-p/339160#M62586</guid>
      <dc:creator>Hemnaath</dc:creator>
      <dc:date>2017-12-14T15:25:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to parse complete command line information into the event field ?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-complete-command-line-information-into-the-event/m-p/339161#M62587</link>
      <description>&lt;P&gt;Hi Dal Jeanis, Can you please guide me on the above comment, so that I can push the changes to the search head master.  &lt;/P&gt;

&lt;P&gt;thanks in advance. &lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2017 17:45:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-complete-command-line-information-into-the-event/m-p/339161#M62587</guid>
      <dc:creator>Hemnaath</dc:creator>
      <dc:date>2017-12-14T17:45:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to parse complete command line information into the event field ?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-complete-command-line-information-into-the-event/m-p/339162#M62588</link>
      <description>&lt;P&gt;Hi Dal Jeanis, Good Morning, can you please guide me on the above comment, so that I can push the props.conf to the search head cluster via deployer. &lt;/P&gt;

&lt;P&gt;thanks in advance.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Dec 2017 11:10:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-complete-command-line-information-into-the-event/m-p/339162#M62588</guid>
      <dc:creator>Hemnaath</dc:creator>
      <dc:date>2017-12-15T11:10:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to parse complete command line information into the event field ?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-complete-command-line-information-into-the-event/m-p/339163#M62589</link>
      <description>&lt;P&gt;Hi All, Can you please guide me on this, I had pushed the above props.conf file into the search head  via deployer but no luck still I could see only partial command information present in the command field. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; [linux_secure]
  ## Event extractions by type
  REPORT-0authentication_for_linux_secure = ssh-login-events, ssh-session-close, ssh-disconnect, sshd_authentication_kerberos_success, sshd_authentication_refused, sshd_authentication_tried
  REPORT-account_management_for_linux_secure = useradd, userdel
  REPORT-firewall = ipfw, ipfw-stealth, ipfw-icmp, pf
  REPORT-routing = iptables
  EXTRACT-command = "sudo:.*?COMMAND=(?[^;]+)(;|$)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;When I searched using the above regex its working, I could see the entire command information in command line.  But same when I added into the Props.conf for the sourcetype = linux_secure and pushed the changes in splunk it did not work, I am getting the partial command information in Command line field. &lt;/P&gt;

&lt;P&gt;Kindly guide me how to parse entire command line information in the command field.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Dec 2017 13:21:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-complete-command-line-information-into-the-event/m-p/339163#M62589</guid>
      <dc:creator>Hemnaath</dc:creator>
      <dc:date>2017-12-15T13:21:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to parse complete command line information into the event field ?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-complete-command-line-information-into-the-event/m-p/339164#M62590</link>
      <description>&lt;P&gt;HI Dal Jeanis, can you please guide me on this, i am not sure why its not taking the complete command line information in command line field. It worked well when i executed the query in the search head.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=unix sourcetype=linux_secure COMMAND | rex   "sudo:.*?COMMAND=(?&amp;lt;COMMAND&amp;gt;[^;]+)(;|$)"

12/15/17
9:34:31.000 AM  
Dec 15 09:34:31 test01 sudo: solarwinds : TTY=pts/2 ; PWD=/opt/solarwinds ; USER=root ; COMMAND=/opt/solarwinds/utilities/check_file.sh -e -f /var/log/audit/audit.log
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But the same regex did not work when we pushed from props.conf  with below stanza added and deployed to the search head cluster members.&lt;/P&gt;

&lt;P&gt;[linux_secure]&lt;BR /&gt;
EXTRACT-command = "sudo:.*?COMMAND=(?[^;]+)(;|$)"&lt;/P&gt;

&lt;P&gt;Please guide me on this. &lt;BR /&gt;
thanks in advance. &lt;/P&gt;</description>
      <pubDate>Fri, 15 Dec 2017 14:39:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-complete-command-line-information-into-the-event/m-p/339164#M62590</guid>
      <dc:creator>Hemnaath</dc:creator>
      <dc:date>2017-12-15T14:39:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to parse complete command line information into the event field ?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-complete-command-line-information-into-the-event/m-p/339165#M62591</link>
      <description>&lt;P&gt;hi somesoni2, can you please guide me on this,  i am not sure why its not taking the complete command line information in command line field(interesting field) . It worked well when executed the below query in the search head.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=unix sourcetype=linux_secure COMMAND | rex   "sudo:.*?COMMAND=(?&amp;lt;COMMAND&amp;gt;[^;]+)(;|$)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;12/15/17&lt;BR /&gt;
 9:34:31.000 AM&lt;BR /&gt;&lt;BR /&gt;
 Dec 15 09:34:31 test01 sudo: solarwinds : TTY=pts/2 ; PWD=/opt/solarwinds ; USER=root ; COMMAND=/opt/solarwinds/utilities/check_file.sh -e -f /var/log/audit/audit.log&lt;/P&gt;

&lt;P&gt;But the same regex did not work when pushed from props.conf with below stanza added and deployed to the search head cluster members.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; [linux_secure]

   EXTRACT-command = "sudo:.*?COMMAND=(?[^;]+)(;|$)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;"Problem"- COMMAND is currently parsed as "/opt/solarwinds/utilities/check_file.sh"&lt;/P&gt;

&lt;P&gt;"Exact Requirement"- Want it parses as "/opt/solarwinds/utilities/check_file.sh -e -f /var/log/audit/audit.log"&lt;/P&gt;

&lt;P&gt;Please guide me on this .... I am not sure where its going wrong. &lt;/P&gt;</description>
      <pubDate>Fri, 15 Dec 2017 16:46:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-complete-command-line-information-into-the-event/m-p/339165#M62591</guid>
      <dc:creator>Hemnaath</dc:creator>
      <dc:date>2017-12-15T16:46:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to parse complete command line information into the event field ?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-complete-command-line-information-into-the-event/m-p/339166#M62592</link>
      <description>&lt;P&gt;I don't think you need the double quotes in your &lt;CODE&gt;EXTRACT&lt;/CODE&gt; line.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Dec 2017 13:47:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-complete-command-line-information-into-the-event/m-p/339166#M62592</guid>
      <dc:creator>micahkemp</dc:creator>
      <dc:date>2017-12-20T13:47:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to parse complete command line information into the event field ?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-complete-command-line-information-into-the-event/m-p/339167#M62593</link>
      <description>&lt;P&gt;Hi micahkemp, it worked after removing the double quotes from the Extract command.&lt;/P&gt;

&lt;P&gt;micahkemp, I am finding difficulties in Field Extraction (Parsing), I tried learning the Under  Props.conf documentation -- Field Extraction but could not understand it, so could please let me know is there way where I can get an Video on Field Extraction (parsing). If you had come across any good video explaining  on Field Extraction both Index time and Search time , please share the link with me.&lt;/P&gt;

&lt;P&gt;thanks in advance .&lt;/P&gt;</description>
      <pubDate>Thu, 21 Dec 2017 11:27:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-complete-command-line-information-into-the-event/m-p/339167#M62593</guid>
      <dc:creator>Hemnaath</dc:creator>
      <dc:date>2017-12-21T11:27:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to parse complete command line information into the event field ?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-complete-command-line-information-into-the-event/m-p/339168#M62594</link>
      <description>&lt;P&gt;I don't have links to any videos or other trainings, other than the free &lt;A href="https://www.splunk.com/view/SP-CAAAPX9"&gt;fundamentals&lt;/A&gt; course, which may not have field extraction content.  You might want to post another question asking for links to free training options.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Dec 2017 11:36:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-complete-command-line-information-into-the-event/m-p/339168#M62594</guid>
      <dc:creator>micahkemp</dc:creator>
      <dc:date>2017-12-21T11:36:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to parse complete command line information into the event field ?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-complete-command-line-information-into-the-event/m-p/339169#M62595</link>
      <description>&lt;P&gt;@hemnath - remove the quotes from around the regex string.  In a conf file, you don't need those quotes.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Dec 2017 15:37:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-complete-command-line-information-into-the-event/m-p/339169#M62595</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-12-21T15:37:07Z</dc:date>
    </item>
  </channel>
</rss>

