Disable Last Message Repeated X Times on Syslog Facility - linux

Sometimes Syslog send line like that :
Aug 12 20:35:57 server sshd[15984]: last message repeated 2 times
I know that we can disable it, in the rsyslog config file :
$RepeatedMsgReduction off
Source : here
That config disable this feature on all syslog facilities.
But my question is : is there any way to disable this feature on only a specific facility (local1 for example) ?
Thanks !

No, according to the manual this option only accepts values on and off. Likewise, the source code only documents these two values:
int bReduceRepeatMsgs; /* reduce repeated message - 0 - no, 1 - yes */

Related

Cannot append to a file: Append replaces the content

The following command does not append but replaces the content
echo 0 >> /sys/block/nvme0n1/queue/nomerges
I don't want to replace but append. But I'm curious Is there something special about this file?
It also doesn't allow more than one character as its input.
Look at https://serverfault.com/questions/865787/what-does-the-nomerge-mean-in-linux-system
It might help you in understanding, that there are only 3 options that the file can take.
Also:
nomerges enables the user to disable the lookup logic involved with IO
merging requests in the block layer. By default (0) all merges are
enabled. When set to 1 only simple one-hit merges will be tried. When
set to 2 no merge algorithms will be tried (including one-hit or more
complex tree/hash lookups).

How to remove/modify syslogd message's header?

I'm currently use the syslogd of busybox for logging some information. However, I'm unable to modify the message's header.
I log the message like this:
syslog(LOG_INFO,"My message\n");
And I got this output:
Jul 4 15:00:11 halo user.info syslog: My message
I want to replace message's header with epoch time format like this:
1529293692,My message
Or is there any way to completely remove the message's header so I could manually add the epoch time in code?
I have done the research around and found that it is impossible to modify the output message log of syslogd with supported configuration. So I dig into the busybox's source code and modify it. If you face the same issue, you could find it at function:
static void timestamp_and_log(int pri, char *msg, int len)
I check the pri variable to see which level log is it and change the actual outcome message, which is msg.

Datastage: String to Timestamp to milli seconds conversion

I'm trying to insert timestamp with milli seconds into a database. I tried following steps but haven't had any luck.
Extend field value to milli seconds , with length 26 and scale 3.
Used StringToTimestamp(timestampInString,"%yyyy-%mm-%dd %hh:%nn:%ss.3"), Resulting null value in output.
Modified the default time Stamp in job properties to %yyyy-%mm-%dd %hh:%nn:%ss.3
Design :
Sequential file --> TX --> destination (SQL/Seq file)
Could you please assist a solution for this?
What you tried looks good so far with one exception:
length 26 and scale 3
Using Db2 for example you would need to specify length 26 precision 6.
26 and 3 do not fit as
%yyyy-%mm-%dd %hh:%nn:%ss has length of 20
Specifying microsenonds is extended attriute is also necessary.
Have a try and provide more details of the target system if you still have problems
try below command in transformer stage and set the target data type as per the requirement, it will give the required result:
StringToTimestamp(Columnname,"%yyyy-%mm-%dd %hh:%nn:%ss.3")
Most important thing is to override the default NLS settings in the job with expected format (%yyyy-%mm-%dd %hh:%nn:%ss.3) which you have already completed.
Now, for the microseconds part which is not being displayed, you can enable the Microseconds extended attribute for the field in the target stage used.
Also you can refer this link from IBM which explains a similar scenario

logstash refresh lookup file when using translate function

I have the yml file which I used the "traslate" function to do lookup.
What was done is to translate a string like "superhost.com" to "found".
My problem is that if I were to add in more entries there entries will not be reflected.
For example
I add a "ultrahost.com" entry into the yml file while logstash is still running. Incoming logs with "ultrahost.com" will not be translated to "found". This will only work after I have restarted the logstash script.
There is a refresh_interval parameter to the translate plugin that can be used to specify how often to re-read the file. The default is 300 seconds (5 minutes). You can lower that to be whatever interval you think will satisfy how often that the file will be updated.

How to list out a GDG base properties through REXX

How to know GDG base properties through REXX code; Of course we can view the GDG limit thru File-aid 3.2 option But need to list the properties on the fly and may be used in consecutive program/module. Hope made you clear and waiting for response!
(Do let me know if any other information is required?)
From REXX, you can target TSO then use the listcat command:
ADDRESS TSO
"LISTCAT ENTRY('XXX') ALL"
where XXX is the GDG base.
For capturing TSO output, look into OUTTRAP which can capture the output from most TSO commands - I haven't specifically tested listcat since I don't have a z900 under my desk at home :-) I'll give it a shot at work tomorrow.
Call OutTrap "xyzzy."
should give you the output into the xyzzy stem variable and you can stop the capture with:
Call OutTrap "off"
Something like this should do it.
/* REXX */
arg entry .
call outtrap "listc."
"LISTCAT ENT("entry") GDG ALL"
if rc > 0 then exit 12
do i = 1 to listc.0
if pos("LIMIT", listc.i) > 0 then do
limit = word(translate(listc.i,' ','-'),2)
say 'GDG limit is' limit
leave
end
end
One caveate to the above suggestion... If you only want GDG entries you may need to consider removing the keyword ALL on the LISTCAT ENTRY('XXX') ALL line. I believe the ALL word will list GDG & Non-GDG datasets that happen to match the catalog entry name.

Resources