<?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: Timestamp and masking syslog through universal forwarder in Splunk Data Stream Processor</title>
    <link>https://community.splunk.com/t5/Splunk-Data-Stream-Processor/How-to-get-timestamp-and-mask-syslog-through-universal-forwarder/m-p/590463#M39</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/244188"&gt;@marellasunil_3&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hey not sure how you came to conclusion that As "sed command have limitation to use only once" there is no such limitation&amp;nbsp;it would replace multiple occurences of the matched regex if the pattern is same you just have to add global attribute "g" at the end&lt;/P&gt;&lt;P&gt;|rex mode=sed field=data "s/Card ((\d+\-)+)/Card XXXX-XXXX-XXXX/g"&lt;/P&gt;&lt;P&gt;example&amp;nbsp;&lt;/P&gt;&lt;P&gt;|makeresults |eval data="23/03/2020 13:45:20:123 IST Systemout ..... Card 1234-5678-9012-3456 Card 1234-5678-9012-3456" |rex mode=sed field=data "s/Card ((\d+\-)+)/Card XXXX-XXXX-XXXX/g"&lt;/P&gt;&lt;P&gt;Note this would only not work in case the pattern is not matching for the second occcurence&amp;nbsp;&lt;/P&gt;&lt;P&gt;And about your&amp;nbsp;Transforms.conf&amp;nbsp;&lt;/P&gt;&lt;P&gt;[session-anonymizer]&lt;BR /&gt;REGEX = XXXX ( you have to define the regex which would be the identifier )&lt;BR /&gt;FORMAT = $1XXXX$2 ($1 and $2) are the captured named group&lt;BR /&gt;DEST_KEY = _raw&lt;/P&gt;&lt;P&gt;[session-anonymizer]&lt;BR /&gt;REGEX = (Card) ((\d+\-)+) ( this is the regex)&lt;BR /&gt;FORMAT = $1XXXX (here there wont be $2 because there is only one group here and your are masking 2nd group so dont include $2&lt;BR /&gt;DEST_KEY = _raw&lt;/P&gt;&lt;P&gt;if you still have trouble i would share more details with screenshot&lt;/P&gt;&lt;P&gt;--------&lt;/P&gt;&lt;P&gt;If you find the answer was helpful, an upvote/karma is appreciated and please accept as solution it would help others as well&lt;/P&gt;</description>
    <pubDate>Wed, 23 Mar 2022 15:24:27 GMT</pubDate>
    <dc:creator>venky1544</dc:creator>
    <dc:date>2022-03-23T15:24:27Z</dc:date>
    <item>
      <title>How to get timestamp and mask syslog through universal forwarder?</title>
      <link>https://community.splunk.com/t5/Splunk-Data-Stream-Processor/How-to-get-timestamp-and-mask-syslog-through-universal-forwarder/m-p/590363#M34</link>
      <description>&lt;P&gt;I have a systemout.log file and I am indexing using pretrained sourcetype &lt;SPAN&gt;websphere_trlog_sysout&lt;/SPAN&gt;. Currently there is an issue with masking&lt;/P&gt;
&lt;P&gt;I have created props.conf in the deployment app and deployed to universal forwarder as below. Created transforms.conf to mask the data.&lt;/P&gt;
&lt;P&gt;Seems the issue is still same.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;[websphere_trlog_sysout]
TIME_FORMAT = %d-%m-%y %H:%M:%S:%3Q %Z
TIME_PREFIX = ^\[
FORMAT = $1-$2-$3 $4:$5:$6:$7 $8
TRANSFORMS-anonymize = session-anonymizer

[session-anonymizer]

REGEX = XXXXX

FORMAT = $1XXXX$2

DEST_KEY = _raw&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2022 22:14:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Data-Stream-Processor/How-to-get-timestamp-and-mask-syslog-through-universal-forwarder/m-p/590363#M34</guid>
      <dc:creator>marellasunil_3</dc:creator>
      <dc:date>2022-03-23T22:14:37Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamp and masking syslog through universal forwarder</title>
      <link>https://community.splunk.com/t5/Splunk-Data-Stream-Processor/How-to-get-timestamp-and-mask-syslog-through-universal-forwarder/m-p/590396#M35</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/244188"&gt;@marellasunil_3&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;you can try the sedcmd in props.conf and dont require in transform but this should go to indexer&lt;BR /&gt;SED script works at index time and executed on _raw field. so should be in indexer&lt;/P&gt;&lt;P&gt;first you can test the&amp;nbsp; sedcmd in a rex in a search: to check if masking is working&amp;nbsp;&lt;/P&gt;&lt;P&gt;|makeresults |eval date="2022-03-23 10:24:19:695+0000"|rex mode=sed field=date max_match=0 "s/(([\d+\-]+) ([\d+:]+))/XXXXXX/"&lt;/P&gt;&lt;P&gt;Just write this is in props.conf . you do not need to write transforms.conf.&lt;/P&gt;&lt;P&gt;[websphere_trlog_sysout]&lt;/P&gt;&lt;P&gt;SEDCMD-replace=/(([\d+\-]+) ([\d+:]+))/XXXXXX/&lt;/P&gt;&lt;P&gt;and then restart the server.&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2022 11:04:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Data-Stream-Processor/How-to-get-timestamp-and-mask-syslog-through-universal-forwarder/m-p/590396#M35</guid>
      <dc:creator>venky1544</dc:creator>
      <dc:date>2022-03-23T11:04:06Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamp and masking syslog through universal forwarder</title>
      <link>https://community.splunk.com/t5/Splunk-Data-Stream-Processor/How-to-get-timestamp-and-mask-syslog-through-universal-forwarder/m-p/590419#M36</link>
      <description>&lt;P&gt;Hi Venky&lt;BR /&gt;Thanks for the reply I am trying to mask card details, that does not have field&lt;/P&gt;&lt;P&gt;Ex: [23/03/2020 13:45:20:123 IST Systemout .....&amp;nbsp; &amp;nbsp; &amp;nbsp; Card 1234-5678-9012-3456]&lt;/P&gt;&lt;P&gt;I would like to mask card details.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2022 12:47:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Data-Stream-Processor/How-to-get-timestamp-and-mask-syslog-through-universal-forwarder/m-p/590419#M36</guid>
      <dc:creator>marellasunil_3</dc:creator>
      <dc:date>2022-03-23T12:47:12Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamp and masking syslog through universal forwarder</title>
      <link>https://community.splunk.com/t5/Splunk-Data-Stream-Processor/How-to-get-timestamp-and-mask-syslog-through-universal-forwarder/m-p/590421#M37</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/244188"&gt;@marellasunil_3&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;try the below search&amp;nbsp;&lt;/P&gt;&lt;P&gt;|makeresults |eval data="23/03/2020 13:45:20:123 IST Systemout ..... Card 1234-5678-9012-3456"|rex mode=sed field=data "s/Card ((\d+\-)+)/Card XXXX-XXXX-XXXX/"&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="venky1544_0-1648040591510.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/18716iC6CBBDF3D57E7B79/image-size/medium?v=v2&amp;amp;px=400" role="button" title="venky1544_0-1648040591510.png" alt="venky1544_0-1648040591510.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and try it in props.conf&amp;nbsp;&lt;/P&gt;&lt;P&gt;[websphere_trlog_sysout]&lt;/P&gt;&lt;P&gt;SEDCMD-replace=s/Card ((\d+\-)+)/Card XXXX-XXXX-XXXX/&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;---&lt;BR /&gt;If this reply helps you, an upvote/karma&amp;nbsp; would be appreciated.&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 23 Mar 2022 13:03:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Data-Stream-Processor/How-to-get-timestamp-and-mask-syslog-through-universal-forwarder/m-p/590421#M37</guid>
      <dc:creator>venky1544</dc:creator>
      <dc:date>2022-03-23T13:03:41Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamp and masking syslog through universal forwarder</title>
      <link>https://community.splunk.com/t5/Splunk-Data-Stream-Processor/How-to-get-timestamp-and-mask-syslog-through-universal-forwarder/m-p/590449#M38</link>
      <description>&lt;P&gt;Thanks Venky.&lt;/P&gt;&lt;P&gt;It is resolved the issue partially. I found Card details in other location as well&amp;nbsp;&lt;/P&gt;&lt;P&gt;As sed command have limitation to use only once, I would like to use regex.&lt;/P&gt;&lt;P&gt;I tried regex command as stated above in the custom app deployed in forwarder. But this is not working at all.&lt;/P&gt;&lt;P&gt;where do you think I did the mistake?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Props.comf&lt;/P&gt;&lt;P&gt;[websphere_trlog_sysout]&lt;BR /&gt;TRANSFORMS-anonymize = session-anonymizer&lt;/P&gt;&lt;P&gt;Transforms.conf&lt;/P&gt;&lt;P&gt;[session-anonymizer]&lt;BR /&gt;REGEX = XXXXX&lt;BR /&gt;FORMAT = $1XXXX$2&lt;BR /&gt;DEST_KEY = _raw&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2022 14:49:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Data-Stream-Processor/How-to-get-timestamp-and-mask-syslog-through-universal-forwarder/m-p/590449#M38</guid>
      <dc:creator>marellasunil_3</dc:creator>
      <dc:date>2022-03-23T14:49:03Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamp and masking syslog through universal forwarder</title>
      <link>https://community.splunk.com/t5/Splunk-Data-Stream-Processor/How-to-get-timestamp-and-mask-syslog-through-universal-forwarder/m-p/590463#M39</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/244188"&gt;@marellasunil_3&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hey not sure how you came to conclusion that As "sed command have limitation to use only once" there is no such limitation&amp;nbsp;it would replace multiple occurences of the matched regex if the pattern is same you just have to add global attribute "g" at the end&lt;/P&gt;&lt;P&gt;|rex mode=sed field=data "s/Card ((\d+\-)+)/Card XXXX-XXXX-XXXX/g"&lt;/P&gt;&lt;P&gt;example&amp;nbsp;&lt;/P&gt;&lt;P&gt;|makeresults |eval data="23/03/2020 13:45:20:123 IST Systemout ..... Card 1234-5678-9012-3456 Card 1234-5678-9012-3456" |rex mode=sed field=data "s/Card ((\d+\-)+)/Card XXXX-XXXX-XXXX/g"&lt;/P&gt;&lt;P&gt;Note this would only not work in case the pattern is not matching for the second occcurence&amp;nbsp;&lt;/P&gt;&lt;P&gt;And about your&amp;nbsp;Transforms.conf&amp;nbsp;&lt;/P&gt;&lt;P&gt;[session-anonymizer]&lt;BR /&gt;REGEX = XXXX ( you have to define the regex which would be the identifier )&lt;BR /&gt;FORMAT = $1XXXX$2 ($1 and $2) are the captured named group&lt;BR /&gt;DEST_KEY = _raw&lt;/P&gt;&lt;P&gt;[session-anonymizer]&lt;BR /&gt;REGEX = (Card) ((\d+\-)+) ( this is the regex)&lt;BR /&gt;FORMAT = $1XXXX (here there wont be $2 because there is only one group here and your are masking 2nd group so dont include $2&lt;BR /&gt;DEST_KEY = _raw&lt;/P&gt;&lt;P&gt;if you still have trouble i would share more details with screenshot&lt;/P&gt;&lt;P&gt;--------&lt;/P&gt;&lt;P&gt;If you find the answer was helpful, an upvote/karma is appreciated and please accept as solution it would help others as well&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2022 15:24:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Data-Stream-Processor/How-to-get-timestamp-and-mask-syslog-through-universal-forwarder/m-p/590463#M39</guid>
      <dc:creator>venky1544</dc:creator>
      <dc:date>2022-03-23T15:24:27Z</dc:date>
    </item>
  </channel>
</rss>

