<?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: Split unix commands in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Split-unix-commands/m-p/512851#M143856</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/129407"&gt;@thambisetty&lt;/a&gt;&amp;nbsp; tried your solution. It throws error.&lt;/P&gt;</description>
    <pubDate>Thu, 06 Aug 2020 19:22:35 GMT</pubDate>
    <dc:creator>dwibedi03</dc:creator>
    <dc:date>2020-08-06T19:22:35Z</dc:date>
    <item>
      <title>Split unix commands</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Split-unix-commands/m-p/512845#M143853</link>
      <description>&lt;P&gt;There is a command fields in my logs and consists of unix commands.&lt;/P&gt;&lt;P&gt;One value is&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="t"&gt;/usr/bin/ssh&lt;/SPAN&gt; &lt;SPAN class="t"&gt;-q&lt;/SPAN&gt; &lt;SPAN class="t"&gt;-o&lt;/SPAN&gt; &lt;SPAN class="t"&gt;ConnectTimeout=5&lt;/SPAN&gt; &lt;SPAN class="t"&gt;-o&lt;/SPAN&gt; &lt;SPAN class="t"&gt;BatchMode=yes&lt;/SPAN&gt;&amp;nbsp;z&lt;SPAN class="t"&gt;evsbdr66599.prodb.cally.org&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN class="t"&gt;netstat&lt;/SPAN&gt; &lt;SPAN class="t"&gt;-rn&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="t"&gt;I am looking to extract&amp;nbsp;netstat -rn.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="t"&gt;Can someone provide me a way to split ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Aug 2020 19:03:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Split-unix-commands/m-p/512845#M143853</guid>
      <dc:creator>dwibedi03</dc:creator>
      <dc:date>2020-08-06T19:03:42Z</dc:date>
    </item>
    <item>
      <title>Re: Split unix commands</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Split-unix-commands/m-p/512850#M143855</link>
      <description>&lt;P&gt;I am assuming all your commands at end of line.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;| rex “(?&amp;lt;command&amp;gt;[\w]+\s[-\w]+)$”&lt;/P&gt;</description>
      <pubDate>Thu, 06 Aug 2020 19:18:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Split-unix-commands/m-p/512850#M143855</guid>
      <dc:creator>thambisetty</dc:creator>
      <dc:date>2020-08-06T19:18:49Z</dc:date>
    </item>
    <item>
      <title>Re: Split unix commands</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Split-unix-commands/m-p/512851#M143856</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/129407"&gt;@thambisetty&lt;/a&gt;&amp;nbsp; tried your solution. It throws error.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Aug 2020 19:22:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Split-unix-commands/m-p/512851#M143856</guid>
      <dc:creator>dwibedi03</dc:creator>
      <dc:date>2020-08-06T19:22:35Z</dc:date>
    </item>
    <item>
      <title>Re: Split unix commands</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Split-unix-commands/m-p/512866#M143862</link>
      <description>&lt;P&gt;Are you looking to extract the field in a query through spl or are you trying to do a field extraction on ingest of the log data?&lt;/P&gt;&lt;P&gt;For the first you would add a field extraction in your props.conf file.&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.5/Knowledge/Exampleconfigurationswithprops.conf" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/8.0.5/Knowledge/Exampleconfigurationswithprops.conf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;For the second you would use the rex command as suggested.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/SCS/current/SearchReference/RexCommandExamples" target="_blank"&gt;https://docs.splunk.com/Documentation/SCS/current/SearchReference/RexCommandExamples&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The regex you would use depends on how consistant your logs are and if you could define a regex to match all of the logs you are concerned with.&amp;nbsp; Here is an example of what might work if all of your logs had the command at the end of the line:&lt;/P&gt;&lt;P&gt;| rex field=_raw&amp;nbsp;&lt;SPAN&gt;“(?&amp;lt;command&amp;gt;[\w]+\s[-\w]*)$”&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The above regex is not perfect.&amp;nbsp; You'll have to account for a command with and without arguments.&amp;nbsp; The above regex isn't perfect if your command doesn't have -xyz arguments.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Aug 2020 19:43:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Split-unix-commands/m-p/512866#M143862</guid>
      <dc:creator>mfasciano_splun</dc:creator>
      <dc:date>2020-08-06T19:43:27Z</dc:date>
    </item>
    <item>
      <title>Re: Split unix commands</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Split-unix-commands/m-p/512867#M143863</link>
      <description>&lt;P&gt;May be because of double quotes using in rex. Remove and input them from your keyboard.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="107B04E0-D2A4-4346-B7D0-4CA369641F71.png" style="width: 1125px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/10092iA1889182C7888F86/image-size/medium?v=v2&amp;amp;px=400" role="button" title="107B04E0-D2A4-4346-B7D0-4CA369641F71.png" alt="107B04E0-D2A4-4346-B7D0-4CA369641F71.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Thu, 06 Aug 2020 19:48:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Split-unix-commands/m-p/512867#M143863</guid>
      <dc:creator>thambisetty</dc:creator>
      <dc:date>2020-08-06T19:48:02Z</dc:date>
    </item>
    <item>
      <title>Re: Split unix commands</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Split-unix-commands/m-p/512869#M143864</link>
      <description>&lt;P&gt;Thanks for your reply. I will check it out.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Aug 2020 19:45:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Split-unix-commands/m-p/512869#M143864</guid>
      <dc:creator>dwibedi03</dc:creator>
      <dc:date>2020-08-06T19:45:22Z</dc:date>
    </item>
    <item>
      <title>Re: Split unix commands</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Split-unix-commands/m-p/512870#M143865</link>
      <description>&lt;P&gt;Yes, i got to make it work. However it is not accounting for all the commands. I will&amp;nbsp; improvise. Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Aug 2020 19:46:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Split-unix-commands/m-p/512870#M143865</guid>
      <dc:creator>dwibedi03</dc:creator>
      <dc:date>2020-08-06T19:46:12Z</dc:date>
    </item>
  </channel>
</rss>

