Fluentd – how to scan log files under different folders? - fluentd

Question 1 : – how to scan log file from different folders ?
Question 2 : - also how can we use the wild char in log file name ?
e.g.
folder\folder1\catalina.92ca.2019-01-07.log
folder\folder1\catalina.92ca.2019-01-06.log
folder\folder2\catalina.567c.2019-01-07.log
folder\folder2\catalina.567c.2019-01-06.log
I tried something like this, which didn't work.
path /var/Logs/folder//catalina..%Y-%m-%d.log

This worked on my Linux box :
path /var/Logs/folder//catalina..%Y-%m-%d.log

Related

Dynamically use current date in OUTPUT EXPORT filename

Stripped down example code using a static file name:
OUTPUT EXPORT /CONTENTS EXPORT=ALL /PDF DOCUMENTFILE='example.pdf'
My question is how to generate a datestamped file. I have tried using $DATE, '$DATE' and running it through a macro but can't seem to find the syntax.
Hey this is a really nice Idea for saving backups in a running syntax production - I will use this myself from now on :) .
So the following syntax works for me:
compute tdy= $time.
formats tdy (date11).
temporary.
select if $casenum=1.
write out="somepath\datemacro.sps" /"define !dated__filename () !quote(!concat('YOUR FILE NAME',' ','", tdy, "','.pdf')) !enddefine.".
exe.
Insert file ="somepath\datemacro.sps".
delete vars tdy.
The file name you used in the code above is now stored in a macro with the date added, and you can use it here:
OUTPUT EXPORT /CONTENTS EXPORT=ALL /PDF DOCUMENTFILE= !dated__filename .
Note that you can change "YOUR FILE NAME" into anything you like, including adding a path. And you can also change ".pdf" so save other kinds of files.
EDIT: Also of course change "somepath" to a valid path on your machine.

How do i compile opencv_ffmpeg.dll file using mingw on windows 10 64 bit?

I have tried many different methods for compiling opencv_ffmpeg.dll but they all fail. Can somebody tell me which mingw (32bit or 64bit) version and msys or msys2 version to use and how to configure them properly for the task.
Thanks in advance.
For Solve "CMake Error at cmake/OpenCVUtils.cmake:1043 (file): ... " Errors In Cmake
Follow This Steps:
You have to download (Manually) your Three required files/dlls
opencv_ffmpeg.dll
opencv_ffmpeg_64.dll
ffmpeg_version.cmake
Each file has its own MD5 HASH code.
So for that, Go to :
C:\[PATH_TO_YOUR_OPENCV]\sources\3rdparty\ffmpeg\ffmpeg.cmake
Open it, And You Get Informaions About All Things.
Now, Find This Line :
FFMPEG_BINARIES_COMMIT xxx...
Note xxx... it's an MD5 HASH Code, You should find only FFMPEG_BINARIES_COMMIT
And Get MD5 Key For Your Version, For Example for me, I got this result :
FFMPEG_BINARIES_COMMIT 2a19d0006415955c79431116e4634f04d5eb5a74
So my MD5 Key is : 2a19d0006415955c79431116e4634f04d5eb5a74 ok !
Finally, Put This MD5 Key In The Link Below,
And Replace [MD5_CODE] With Your MD5 Key Code ^^
Also Replace the name of Each File/dlls of Required List in [FILE].
https://raw.githubusercontent.com/opencv/opencv_3rdparty/[MD5_CODE]/ffmpeg/[FILE]
Start Download Each File With Link
opencv_ffmpeg.dll:
https://raw.githubusercontent.com/opencv/opencv_3rdparty/2a19d0006415955c79431116e4634f04d5eb5a74/ffmpeg/opencv_ffmpeg.dll
opencv_ffmpeg_64.dll:
https://raw.githubusercontent.com/opencv/opencv_3rdparty/2a19d0006415955c79431116e4634f04d5eb5a74/ffmpeg/opencv_ffmpeg_64.dll
ffmpeg_version.cmake:
https://raw.githubusercontent.com/opencv/opencv_3rdparty/2a19d0006415955c79431116e4634f04d5eb5a74/ffmpeg/ffmpeg_version.cmake
When you finish
Go to:
C:\[PATH_TO_YOUR_OPENCV]\sources\3rdparty\ffmpeg\downloads
Each of 3 file/dlls Have a MD5 HASH code, ok!
opencv_ffmpeg.dll
opencv_ffmpeg_64.dll
ffmpeg_version.cmake
So you have to know it,
Because the name of each folder must be an MD5 code.
Add Three Folders :
First Folder Name : MD5 HASH code of opencv_ffmpeg.dll
put into : opencv_ffmpeg.dll
Second Folder Name : MD5 HASH code of opencv_ffmpeg_64.dll
put into : opencv_ffmpeg_64.dll
Third Folder Name: MD5 HASH code of ffmpeg_version.cmake
put into : ffmpeg_version.cmake
That's All :)
be sure you are using 32 Bit softwares
be sure you have internet connection while using CMAKE for configuration.
be sure to activate your windows.

Fuse File System- general input/output error while accessing office files

I have written a fuse mirror file system using FUSE-JNA, Which mirror local directory.
This Mirror file system allow me to open all types of files correctly with no issue but it does not open all types of office files e.g. .docs , .xls etc. And give me be below error while opening any office file.
Note:
I thought its LibreOffice issue, so I removed it and installed OpenOffice. But get the same issue.
Secondly, the errors only pops up when I try to access an office file from my MirrorFileSystem. Office files opens correctly if accessed normally via ubuntu default file system.
So its some thing wrong with my File system.
Finally, (i don't know whether its related to the question or not but) in my mirror file system when I Right Click on a file>Properties> Permission its shows all the fields disabled, as below
This is my getatt() method:
public int getattr(final String path, final StatWrapper stat)
{
....
if (f.isFile())
{
stat.setMode(NodeType.FILE,true,true,true,true,true,true,true,true,true);
stat.size(f.length());
stat.atime(f.lastModified()/ 1000L);
stat.mtime(0);
stat.nlink(1);
stat.uid(0);
stat.gid(0);
stat.blocks((int) ((f.length() + 511L) / 512L));
return 0;
}
...
}
Please guide me how to fix general input/output error while office files?
Office files are not special. There is some other problem with your filesystem implementation, and you need to do more debugging work to find out precisely what the trigger and the cause is. It's very unlikely that the trigger truly is "the file is an office file", unless you have stuff in your filesystem code that operates differently based on the type of file it's dealing with (in which case you should look there). As a first debugging step, you could compare the sha1sum and stat output of the files from the fuse filesystem and from the root filesystem to see if they match. If they don't, adjust the filesystem code such that they do. You could also enable logging on your filesystem class and check if it's returning an I/O error code anywhere. The error message "general input/output error" makes it sound like that is the case.
As for the reason the permissions fields are disabled, that's because the file is owned by root, and you are not root so you can't change the permissions. The reason the file is owned by root is because you set stat.uid(0); and stat.gid(0); in getattr. UID 0 and GID 0 are for the root user and root group respectively. Fuse-JNA already puts the current UID and GID as default stat attributes in getattr, so if you want to use these then just don't call stat.uid(0); or stat.gid(0);.
Thanks for the answer.
I searched on web, on many websites they showed file locking as the reason e.g. https://forum.openoffice.org/en/forum/viewtopic.php?f=10&t=2020 etc
So in fuse, I implemented file lock function and simply return 0
My problem solved. Now I can open all types of office files.
But I do not know, is it perfect solution

Check Free Space in Windows NT 5.1 and newer platforms in NSIS

I am trying to use this script:
http://nsis.sourceforge.net/CheckSpaceFree
But it lacks some fundamental checks and adjustments ( comments ) for the case(s), where:
1) The $INSTDIR Path contains Program Files directory, which is Access protected, therefore, even if running setup with admin priviledges, you still get 0 integer return when, for example, your path ( absolute or relative ) lands on program files directory.
Failing Test path: C:\Program Files(x86)\BlaBlaBla\
Working test path: C:\BlaBlaBla
2) If I try to use relative path containing one level up (..\BlaBlaBla) AND point it to Disk root ( C:\ ), then path summerizes to C:\..\BlaBlaBla , resulting that nsis simply crashes.
Any best-pratice based way to gracefully work around these limitations?
Thank you all for any input!
Have you tried DriveSpace from the "useful headers" included with NSIS?

load_plugin_textdomain not working

Hey i'm trying to localize a plugin called Donate Plus ( which locallized technicly).
the plugin came with en_CA and de_DE files, i've tried creating a he_IL file without success.
So i've tried with the de files came with the plugin but didn't work.
I've set the WPLANG in wp-config.php to de_DE yet that dosen't change the code.
this is the setting code :
load_plugin_textdomain( 'dplus', '/wp-content/plugins/donate-plus' );
And i did check that all the string are set to be localized.
Anyone has a clue?
I just was with a similar isue, did you try to rename your files from de_DE.po and de_DE.mo to name-of-plugin-de_DE.mo and name-of-plugin-de_DE.po (changing name-of-plugin with yours, of course)?
dplus-de_DE.mo and dplus-de_DE.po It must work ;)
load_plugin_textdomain takes three parameters.
In your case it would be something like this (assuming the .po and .mo files are located in a subdir called 'languages')
load_plugin_textdomain( 'dplus', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
I checked the source of DonatePlus Plugin and I found that the Plugin is doing localization wrongly.
The load_plugin_textdomain() call is made inside the DonatePlus classes constructor. But it should be present inside the 'init' hook. Trying adding the following code (which is at the of the file) inside the init function.
if( class_exists('DonatePlus') )
$donateplus = new DonatePlus();
Where are all the .po and .mo files stored? Are they inside the /wp-content/plugins/donate-plus folder itself? If not then change the path or move the files.
I had a similar issue where I was loading the translation files with the load_plugin_textdomain function from within a service class using PSR-4. This meant that the dirname( plugin_basename( __FILE__ ) ) string returned the wrong path.
The correct path is the relative path your-plugin/languages (assuming you are loading the translation files from the /languages directory).
Absolute paths such as /var/www/html/wp-content/plugins/my-plugin/languages won't work.
My plugins file structure looks something like this:
- my-plugin
- assets
- languages
- services
- Api
- Base
Translation.php
- ...
Plugin.php
- vendor
- views
composer.json
composer.lock
index.php
my-plugin.php
uninstall.php
Since my Translation service is placed in the /services/Base/ directory, this worked for me:
$root = plugin_basename(dirname(__FILE__, 3));
load_plugin_textdomain( 'my-plugin', false, "$root/languages/");
Also, I used no action hook at all instead of init or plugins_loaded and fired the load_plugin_textdomain function at the beginning of the plugin, since the hooks don't fire early enough for the admin menu and action links to get translated.
Use:
load_textdomain( TEXT_DOMAIN , WP_PLUGIN_DIR .'/'.dirname( plugin_basename( FILE ) ) . '/languages/'. get_locale() .'.mo' );

Resources